Skip to content

Adjust pretty name of closures on PHP 8.4 #471

Adjust pretty name of closures on PHP 8.4

Adjust pretty name of closures on PHP 8.4 #471

Triggered via pull request July 8, 2024 07:41
@vjikvjik
synchronize #96
staabm:patch-1
Status Success
Total duration 40s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation / roave-infection
Fit to window
Zoom out
Zoom in

Annotations

7 warnings
mutation / PHP 8.1-ubuntu-latest: src/ArgumentException.php#L105
Escaped Mutant for Mutator "UnwrapArrayMap": --- Original +++ New @@ @@ if ($type instanceof ReflectionUnionType) { /** @var ReflectionNamedType[] $types */ $types = $type->getTypes(); - return implode('|', array_map(static fn(ReflectionNamedType $r) => $r->getName(), $types)) . ' '; + return implode('|', $types) . ' '; } if ($type instanceof ReflectionIntersectionType) { /** @var ReflectionNamedType[] $types */
mutation / PHP 8.1-ubuntu-latest: src/ArgumentException.php#L113
Escaped Mutant for Mutator "UnwrapArrayMap": --- Original +++ New @@ @@ if ($type instanceof ReflectionIntersectionType) { /** @var ReflectionNamedType[] $types */ $types = $type->getTypes(); - return implode('&', array_map(static fn(ReflectionNamedType $r) => $r->getName(), $types)) . ' '; + return implode('&', $types) . ' '; } return ''; } }
mutation / PHP 8.1-ubuntu-latest: src/Injector.php#L45
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ * Enable memoization of class reflections for improved performance when resolving the same objects multiple times. * Note: Enabling this feature may increase memory usage. */ - public function withCacheReflections(bool $cacheReflections = true) : self + public function withCacheReflections(bool $cacheReflections = false) : self { $new = clone $this; $new->cacheReflections = $cacheReflections;
mutation / PHP 8.1-ubuntu-latest: src/Injector.php#L239
Escaped Mutant for Mutator "IfNegation": --- Original +++ New @@ @@ // Throw NotFoundExceptionInterface throw $error; } - if ($isVariadic) { + if (!$isVariadic) { return true; } return null;
mutation / PHP 8.1-ubuntu-latest: src/Injector.php#L339
Escaped Mutant for Mutator "AssignCoalesce": --- Original +++ New @@ @@ private function getClassReflection(string $class) : ReflectionClass { if ($this->cacheReflections) { - return $this->reflectionsCache[$class] ??= new ReflectionClass($class); + return $this->reflectionsCache[$class] = new ReflectionClass($class); } return new ReflectionClass($class); } }
mutation / PHP 8.1-ubuntu-latest: src/ResolvingState.php#L99
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ foreach ($generator as &$value) { $this->addResolvedValue($value); } - return true; + return false; } /** * Resolve parameter using type intersection rules.
mutation / PHP 8.1-ubuntu-latest: src/ResolvingState.php#L121
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ if (!$variadic) { return true; } - $resolved = true; + $resolved = false; } return $resolved; }