improve assert #164
Annotations
1 error and 10 warnings
Mutation testing (Infection)
Process completed with exit code 1.
|
Mutation testing (Infection):
src/Dependencies.php#L59
Escaped Mutant for Mutator "CloneRemoval":
@@ @@
}
public function withRoute(RouteInterface ...$route): self
{
- $new = clone $this;
+ $new = $this;
foreach ($route as $item) {
$new->addRoute($item);
}
|
Mutation testing (Infection):
src/Dependencies.php#L87
Escaped Mutant for Mutator "ArrayOneItem":
@@ @@
{
$extracted = [];
if (!$this->has($className)) {
- return $extracted;
+ return count($extracted) > 1 ? array_slice($extracted, 0, 1, true) : $extracted;
}
$parameters = $this->get($className);
$extracted = array_intersect_key($container, array_flip($parameters->keys()));
|
Mutation testing (Infection):
src/Dependencies.php#L169
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
*/
private function errorMessage(array $errors): string
{
- return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
+ return count($errors) === 2 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
}
private function addRoute(RouteInterface $route): void
{
|
Mutation testing (Infection):
src/Dependencies.php#L169
Escaped Mutant for Mutator "Identical":
@@ @@
*/
private function errorMessage(array $errors): string
{
- return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
+ return count($errors) !== 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
}
private function addRoute(RouteInterface $route): void
{
|
Mutation testing (Infection):
src/Dependencies.php#L169
Escaped Mutant for Mutator "Ternary":
@@ @@
*/
private function errorMessage(array $errors): string
{
- return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
+ return count($errors) === 1 ? implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors)) : $errors[0];
}
private function addRoute(RouteInterface $route): void
{
|
Mutation testing (Infection):
src/Dependencies.php#L171
Escaped Mutant for Mutator "UnwrapArrayMap":
@@ @@
*/
private function errorMessage(array $errors): string
{
- return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
+ return count($errors) === 1 ? $errors[0] : implode("\n\n", $errors);
}
private function addRoute(RouteInterface $route): void
{
|
Mutation testing (Infection):
src/Dependencies.php#L171
Escaped Mutant for Mutator "UnwrapArrayMap":
@@ @@
*/
private function errorMessage(array $errors): string
{
- return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
+ return count($errors) === 1 ? $errors[0] : implode("\n\n", array_keys($errors));
}
private function addRoute(RouteInterface $route): void
{
|
Mutation testing (Infection):
src/Dependencies.php#L172
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
*/
private function errorMessage(array $errors): string
{
- return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
+ return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 0) . '] ' . $error, array_keys($errors), $errors));
}
private function addRoute(RouteInterface $route): void
{
|
Mutation testing (Infection):
src/Dependencies.php#L172
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
*/
private function errorMessage(array $errors): string
{
- return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
+ return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 2) . '] ' . $error, array_keys($errors), $errors));
}
private function addRoute(RouteInterface $route): void
{
|
Mutation testing (Infection):
src/Dependencies.php#L172
Escaped Mutant for Mutator "Plus":
@@ @@
*/
private function errorMessage(array $errors): string
{
- return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i + 1) . '] ' . $error, array_keys($errors), $errors));
+ return count($errors) === 1 ? $errors[0] : implode("\n\n", array_map(fn($i, $error) => '- [' . ($i - 1) . '] ' . $error, array_keys($errors), $errors));
}
private function addRoute(RouteInterface $route): void
{
|
Loading