Skip to content

Use static function, inline call #1094

Use static function, inline call

Use static function, inline call #1094

Triggered via pull request June 16, 2024 21:06
@samdarksamdark
synchronize #364
performance
Status Success
Total duration 3m 40s
Artifacts

mutation.yml

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

Annotations

10 warnings
mutation / PHP 8.1-ubuntu-latest: src/CompositeContainer.php#L61
Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ $tags = []; foreach ($this->containers as $container) { if (!$container instanceof Container) { - continue; + break; } if ($container->has($id)) { /** @psalm-suppress MixedArgument `Container::get()` always return array for tag */
mutation / PHP 8.1-ubuntu-latest: src/CompositeContainer.php#L84
Escaped Mutant for Mutator "UnwrapFinally": --- Original +++ New @@ @@ } catch (Throwable $t) { $hasException = true; $exceptions[] = [$t, $container]; - } finally { - if (!$hasException) { - $exceptions[] = [new RuntimeException('Container "has()" returned false, but no exception was thrown from "get()".'), $container]; - } + } + if (!$hasException) { + $exceptions[] = [new RuntimeException('Container "has()" returned false, but no exception was thrown from "get()".'), $container]; } } throw new CompositeNotFoundException($exceptions);
mutation / PHP 8.1-ubuntu-latest: src/Container.php#L287
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } $this->delegates->attach($delegate); } - $this->definitions->setDelegateContainer($this->delegates); + } /** * @param mixed $definition Definition to validate.
mutation / PHP 8.1-ubuntu-latest: src/Container.php#L314
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ $methodsAndProperties = $definition['methodsAndProperties']; $definition = array_merge( $class === null ? [] : [ArrayDefinition::CLASS_NAME => $class], - [ArrayDefinition::CONSTRUCTOR => $constructorArguments], + [], // extract only value from parsed definition method array_map(static fn(array $data): mixed => $data[2], $methodsAndProperties) );
mutation / PHP 8.1-ubuntu-latest: src/Container.php#L500
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ } throw new CircularReferenceException(sprintf('Circular reference to "%s" detected while building: %s.', $id, implode(', ', array_keys($this->building)))); } - $this->building[$id] = 1; + $this->building[$id] = 2; try { if (!$this->definitions->has($id)) { throw new NotFoundException($id, $this->definitions->getBuildStack());
mutation / PHP 8.1-ubuntu-latest: src/ContainerConfig.php#L33
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function withDefinitions(array $definitions) : self { - $new = clone $this; + $new = $this; $new->definitions = $definitions; return $new; }
mutation / PHP 8.1-ubuntu-latest: src/ContainerConfig.php#L48
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function withProviders(array $providers) : self { - $new = clone $this; + $new = $this; $new->providers = $providers; return $new; }
mutation / PHP 8.1-ubuntu-latest: src/ContainerConfig.php#L63
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function withTags(array $tags) : self { - $new = clone $this; + $new = $this; $new->tags = $tags; return $new; }
mutation / PHP 8.1-ubuntu-latest: src/ContainerConfig.php#L78
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function withValidate(bool $validate) : self { - $new = clone $this; + $new = $this; $new->validate = $validate; return $new; }
mutation / PHP 8.1-ubuntu-latest: src/ContainerConfig.php#L95
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function withDelegates(array $delegates) : self { - $new = clone $this; + $new = $this; $new->delegates = $delegates; return $new; }