Skip to content

New syntax

New syntax #867

Triggered via pull request November 9, 2023 07:22
Status Failure
Total duration 1m 1s
Artifacts
This run and associated checks have been archived and are scheduled for deletion. Learn more about checks retention

mutation.yml

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

Annotations

1 error and 10 warnings
mutation / PHP 8.1-ubuntu-latest
Process completed with exit code 1.
mutation / PHP 8.1-ubuntu-latest: src/Builder/GroupBuilder.php#L133
Escaped Mutant for Mutator "UnwrapArrayValues": --- Original +++ New @@ @@ public function hosts(string ...$hosts) : self { $new = clone $this; - $new->hosts = array_values($hosts); + $new->hosts = $hosts; return $new; } /**
mutation / PHP 8.1-ubuntu-latest: src/Builder/RouteBuilder.php#L119
Escaped Mutant for Mutator "UnwrapArrayValues": --- Original +++ New @@ @@ public function hosts(string ...$hosts) : self { $route = clone $this; - $route->hosts = array_values($hosts); + $route->hosts = $hosts; return $route; } /**
mutation / PHP 8.1-ubuntu-latest: src/Group.php#L95
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ { return $this->disabledMiddlewares; } - public function setRoutes(array $routes) : self + protected function setRoutes(array $routes) : self { $this->assertRoutes($routes); $this->routes = $routes;
mutation / PHP 8.1-ubuntu-latest: src/Group.php#L199
Escaped Mutant for Mutator "Foreach_": --- Original +++ New @@ @@ private function assertRoutes(array $routes) : void { /** @var Group|RoutableInterface|Route $route */ - foreach ($routes as $route) { + foreach (array() as $route) { if ($route instanceof Route || $route instanceof self || $route instanceof RoutableInterface) { continue; }
mutation / PHP 8.1-ubuntu-latest: src/Group.php#L200
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ { /** @var Group|RoutableInterface|Route $route */ foreach ($routes as $route) { - if ($route instanceof Route || $route instanceof self || $route instanceof RoutableInterface) { + if ($route instanceof Route && $route instanceof self || $route instanceof RoutableInterface) { continue; } throw new \InvalidArgumentException('Invalid $routes provided, array of `Route` or `Group` or `RoutableInterface` instance expected.');
mutation / PHP 8.1-ubuntu-latest: src/Group.php#L201
Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ /** @var Group|RoutableInterface|Route $route */ foreach ($routes as $route) { if ($route instanceof Route || $route instanceof self || $route instanceof RoutableInterface) { - continue; + break; } throw new \InvalidArgumentException('Invalid $routes provided, array of `Route` or `Group` or `RoutableInterface` instance expected.'); } } }
mutation / PHP 8.1-ubuntu-latest: src/Route.php#L65
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ * It is useful to avoid invoking one of the parent group middleware for * a certain route. */ - public function __construct(array $methods, private string $pattern, private ?string $name = null, array|callable|string $action = null, array $middlewares = [], array $defaults = [], array $hosts = [], private bool $override = false, private array $disabledMiddlewares = []) + public function __construct(array $methods, private string $pattern, private ?string $name = null, array|callable|string $action = null, array $middlewares = [], array $defaults = [], array $hosts = [], private bool $override = true, private array $disabledMiddlewares = []) { if (empty($methods)) { throw new InvalidArgumentException('$methods cannot be empty.');
mutation / PHP 8.1-ubuntu-latest: src/Route.php#L147
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ } return $this->enabledMiddlewaresCache; } - public function setMethods(array $methods) : self + protected function setMethods(array $methods) : self { $this->assertListOfStrings($methods, 'methods'); $this->methods = $methods;
mutation / PHP 8.1-ubuntu-latest: src/Route.php#L187
Escaped Mutant for Mutator "LogicalNot": --- Original +++ New @@ @@ { /** @var mixed $value */ foreach ($defaults as $key => $value) { - if (!is_scalar($value) && !$value instanceof Stringable) { + if (!is_scalar($value) && $value instanceof Stringable) { throw new \InvalidArgumentException('Invalid $defaults provided, list of scalar or `Stringable` instance expected.'); } $this->defaults[$key] = (string) $value;
mutation / PHP 8.1-ubuntu-latest: src/Route.php#L187
Escaped Mutant for Mutator "LogicalAndAllSubExprNegation": --- Original +++ New @@ @@ { /** @var mixed $value */ foreach ($defaults as $key => $value) { - if (!is_scalar($value) && !$value instanceof Stringable) { + if (is_scalar($value) && $value instanceof Stringable) { throw new \InvalidArgumentException('Invalid $defaults provided, list of scalar or `Stringable` instance expected.'); } $this->defaults[$key] = (string) $value;