Fix codecov #64
Annotations
7 warnings
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L106
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
*
* @psalm-suppress InvalidPropertyFetch, MixedArrayAccess
*/
- $action = $possibleAction ?? ($controllerClass::$actions ?? ['HEAD' => 'head', 'OPTIONS' => 'options', 'GET' => 'index', 'POST' => 'create', 'PUT' => 'update', 'PATCH' => 'patch', 'DELETE' => 'delete'])[$request->getMethod()] ?? null;
+ $action = $possibleAction ?? ($controllerClass::$actions ?? ['OPTIONS' => 'options', 'GET' => 'index', 'POST' => 'create', 'PUT' => 'update', 'PATCH' => 'patch', 'DELETE' => 'delete'])[$request->getMethod()] ?? null;
if ($action === null) {
continue;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L116
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
*/
$action = $possibleAction ?? ($controllerClass::$actions ?? ['HEAD' => 'head', 'OPTIONS' => 'options', 'GET' => 'index', 'POST' => 'create', 'PUT' => 'update', 'PATCH' => 'patch', 'DELETE' => 'delete'])[$request->getMethod()] ?? null;
if ($action === null) {
- continue;
+ break;
}
if (!method_exists($controllerClass, $action)) {
continue;
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L152
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
if (!str_starts_with($path, $this->routePrefix)) {
return;
}
- $path = mb_substr($path, mb_strlen($this->routePrefix));
+ $path = mb_substr($path, strlen($this->routePrefix));
if ($path === '') {
$path = '/';
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L152
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
if (!str_starts_with($path, $this->routePrefix)) {
return;
}
- $path = mb_substr($path, mb_strlen($this->routePrefix));
+ $path = substr($path, mb_strlen($this->routePrefix));
if ($path === '') {
$path = '/';
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L172
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
(yield [$this->cleanClassname($this->namespace . '\\' . $this->baseControllerDirectory . '\\' . $this->defaultControllerName . $this->classPostfix), $possibleAction]);
return;
}
- $controllerName = preg_replace_callback('#(/.)#u', static fn(array $matches) => mb_strtoupper($matches[1]), $path);
+ $controllerName = preg_replace_callback('#(/.)#u', static fn(array $matches) => mb_strtoupper($matches[0]), $path);
if (!preg_match('#^(.*?)/([^/]+)/?$#', $controllerName, $matches)) {
return;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L190
Escaped Mutant for Mutator "PregMatchRemoveDollar":
--- Original
+++ New
@@ @@
$directoryPath = $matches[1];
$controllerName = $matches[2];
(yield [$this->cleanClassname($this->namespace . '\\' . $this->baseControllerDirectory . '\\' . $directoryPath . '\\' . $controllerName . $this->classPostfix), $possibleAction]);
- if (preg_match('#^(.*?)/([^/]+)/?$#', $directoryPath, $matches)) {
+ if (preg_match('#^(.*?)/([^/]+)/?#', $directoryPath, $matches)) {
$possibleAction = strtolower($controllerName);
$directoryPath = $matches[1];
$controllerName = $matches[2];
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L210
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
}
private function cleanClassname(string $className) : string
{
- return str_replace(['\\/\\', '\\/', '\\\\'], '\\', $className);
+ return str_replace(['\\/', '\\\\'], '\\', $className);
}
}
|