Skip to content

Fix object creation with correct precision type (#78) #12

Fix object creation with correct precision type (#78)

Fix object creation with correct precision type (#78) #12

Triggered via push October 31, 2024 17:51
Status Success
Total duration 1m 20s
Artifacts

infection.yml

on: push
5️⃣ Mutation Testing
1m 13s
5️⃣ Mutation Testing
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
5️⃣ Mutation Testing: src/Decoder.php#L51
Escaped Mutant for Mutator "Coalesce": @@ @@ private OtherObjectManagerInterface $otherTypeManager; public function __construct(?TagManagerInterface $tagObjectManager = null, ?OtherObjectManagerInterface $otherTypeManager = null) { - $this->tagObjectManager = $tagObjectManager ?? $this->generateTagManager(); + $this->tagObjectManager = $this->generateTagManager() ?? $tagObjectManager; $this->otherTypeManager = $otherTypeManager ?? $this->generateOtherObjectManager(); } public static function create(?TagManagerInterface $tagObjectManager = null, ?OtherObjectManagerInterface $otherTypeManager = null): self
5️⃣ Mutation Testing: src/Decoder.php#L52
Escaped Mutant for Mutator "Coalesce": @@ @@ public function __construct(?TagManagerInterface $tagObjectManager = null, ?OtherObjectManagerInterface $otherTypeManager = null) { $this->tagObjectManager = $tagObjectManager ?? $this->generateTagManager(); - $this->otherTypeManager = $otherTypeManager ?? $this->generateOtherObjectManager(); + $this->otherTypeManager = $this->generateOtherObjectManager() ?? $otherTypeManager; } public static function create(?TagManagerInterface $tagObjectManager = null, ?OtherObjectManagerInterface $otherTypeManager = null): self {
5️⃣ Mutation Testing: src/Decoder.php#L127
Escaped Mutant for Mutator "FalseValue": @@ @@ return $object; case CBORObject::MAJOR_TYPE_TAG: //6 - return $this->tagObjectManager->createObjectForValue($ai, $val, $this->process($stream, false)); + return $this->tagObjectManager->createObjectForValue($ai, $val, $this->process($stream, true)); case CBORObject::MAJOR_TYPE_OTHER_TYPE: //7 return $this->otherTypeManager->createObjectForValue($ai, $val);
5️⃣ Mutation Testing: src/Decoder.php#L141
Escaped Mutant for Mutator "SharedCaseRemoval": @@ @@ throw new InvalidArgumentException('Cannot parse the data. No enclosing indefinite.'); } return BreakObject::create(); - case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER: //0 case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER: //1
5️⃣ Mutation Testing: src/Decoder.php#L141
Escaped Mutant for Mutator "SharedCaseRemoval": @@ @@ } return BreakObject::create(); case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER: - //0 - case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER: //1 case CBORObject::MAJOR_TYPE_TAG: //6
5️⃣ Mutation Testing: src/Decoder.php#L141
Escaped Mutant for Mutator "SharedCaseRemoval": @@ @@ case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER: //0 case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER: - //1 - case CBORObject::MAJOR_TYPE_TAG: //6 default: throw new InvalidArgumentException(sprintf('Cannot parse the data. Found infinite length for Major Type "%s" (%d).', str_pad(decbin($mt), 5, '0', STR_PAD_LEFT), $mt));
5️⃣ Mutation Testing: src/Decoder.php#L141
Escaped Mutant for Mutator "SharedCaseRemoval": @@ @@ case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER: //1 case CBORObject::MAJOR_TYPE_TAG: - //6 - default: throw new InvalidArgumentException(sprintf('Cannot parse the data. Found infinite length for Major Type "%s" (%d).', str_pad(decbin($mt), 5, '0', STR_PAD_LEFT), $mt)); } }
5️⃣ Mutation Testing: src/IndefiniteLengthByteStringObject.php#L30
Escaped Mutant for Mutator "CastString": @@ @@ { $result = parent::__toString(); foreach ($this->chunks as $chunk) { - $result .= (string) $chunk; + $result .= $chunk; } return $result . "\xff"; }
5️⃣ Mutation Testing: src/IndefiniteLengthListObject.php#L39
Escaped Mutant for Mutator "CastString": @@ @@ { $result = parent::__toString(); foreach ($this->data as $object) { - $result .= (string) $object; + $result .= $object; } return $result . "\xff"; }
5️⃣ Mutation Testing: src/IndefiniteLengthListObject.php#L56
Escaped Mutant for Mutator "InstanceOf_": @@ @@ */ public function normalize(): array { - return array_map(static fn(CBORObject $object) => $object instanceof Normalizable ? $object->normalize() : $object, $this->data); + return array_map(static fn(CBORObject $object) => true ? $object->normalize() : $object, $this->data); } public function add(CBORObject $item): self {