Specify return type error #565
Annotations
9 warnings
mutation / PHP 8.1-ubuntu-latest:
src/Exception/AbstractInvalidMiddlewareException.php#L28
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
public function __construct(protected mixed $definition, string $message, ?Throwable $previous = null)
{
$this->definitionString = DefinitionHelper::convertDefinitionToString($definition);
- parent::__construct($message, 0, $previous);
+ parent::__construct($message, -1, $previous);
}
public function getSolution() : ?string
{
|
mutation / PHP 8.1-ubuntu-latest:
src/Exception/AbstractInvalidMiddlewareException.php#L28
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
public function __construct(protected mixed $definition, string $message, ?Throwable $previous = null)
{
$this->definitionString = DefinitionHelper::convertDefinitionToString($definition);
- parent::__construct($message, 0, $previous);
+ parent::__construct($message, 1, $previous);
}
public function getSolution() : ?string
{
|
mutation / PHP 8.1-ubuntu-latest:
src/Exception/AbstractInvalidMiddlewareException.php#L33
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
}
public function getSolution() : ?string
{
- $solution = [<<<SOLUTION
-## Got definition value
-
-`{$this->definitionString}`
-SOLUTION
-];
+ $solution = [];
$suggestion = $this->generateSuggestion();
if ($suggestion !== null) {
$solution[] = '## Suggestion';
|
mutation / PHP 8.1-ubuntu-latest:
src/Exception/AbstractInvalidMiddlewareException.php#L102
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
{
if (DefinitionHelper::isControllerWithNonExistAction($this->definition)) {
return <<<SOLUTION
-Class `{$this->definition[0]}` exists, but does not contain method `{$this->definition[1]}()`.
+Class `{$this->definition[1]}` exists, but does not contain method `{$this->definition[1]}()`.
Try adding `{$this->definition[1]}()` action to `{$this->definition[0]}` controller:
|
mutation / PHP 8.1-ubuntu-latest:
src/Exception/AbstractInvalidMiddlewareException.php#L102
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
{
if (DefinitionHelper::isControllerWithNonExistAction($this->definition)) {
return <<<SOLUTION
-Class `{$this->definition[0]}` exists, but does not contain method `{$this->definition[1]}()`.
+Class `{$this->definition[0]}` exists, but does not contain method `{$this->definition[0]}()`.
Try adding `{$this->definition[1]}()` action to `{$this->definition[0]}` controller:
|
mutation / PHP 8.1-ubuntu-latest:
src/Exception/AbstractInvalidMiddlewareException.php#L107
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
Try adding `{$this->definition[1]}()` action to `{$this->definition[0]}` controller:
```php
-public function {$this->definition[1]}(): ResponseInterface
+public function {$this->definition[0]}(): ResponseInterface
{
// TODO: Implement your action
}
|
mutation / PHP 8.1-ubuntu-latest:
src/MiddlewareFactory.php#L154
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
return false;
}
try {
- DefinitionValidator::validateArrayDefinition($definition);
+
} catch (InvalidConfigException) {
return false;
}
|
mutation / PHP 8.1-ubuntu-latest:
src/MiddlewareFactory.php#L205
Escaped Mutant for Mutator "UnwrapArrayMerge":
--- Original
+++ New
@@ @@
{
$parameters = [$request, $handler];
if ($this->parametersResolver !== null) {
- $parameters = array_merge($parameters, $this->parametersResolver->resolve($this->callableParameters, $request));
+ $parameters = $this->parametersResolver->resolve($this->callableParameters, $request);
}
/** @var MiddlewareInterface|mixed|ResponseInterface $response */
$response = (new Injector($this->container))->invoke($this->callback, $parameters);
|
mutation / PHP 8.1-ubuntu-latest:
src/MiddlewareFactory.php#L265
Escaped Mutant for Mutator "UnwrapArrayMerge":
--- Original
+++ New
@@ @@
$controller = $this->container->get($this->class);
$parameters = [$request, $handler];
if ($this->parametersResolver !== null) {
- $parameters = array_merge($parameters, $this->parametersResolver->resolve($this->actionParameters, $request));
+ $parameters = $this->parametersResolver->resolve($this->actionParameters, $request);
}
/** @var mixed|ResponseInterface $response */
$response = (new Injector($this->container))->invoke([$controller, $this->method], $parameters);
|