Cleanup #53
Annotations
10 warnings
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L36
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function withBaseControllerDirectory(string $directory) : self
{
- $new = clone $this;
+ $new = $this;
$new->baseControllerDirectory = $directory;
return $new;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L47
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function withClassPostfix(string $postfix) : self
{
- $new = clone $this;
+ $new = $this;
$new->classPostfix = $postfix;
return $new;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L60
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function withNamespace(string $namespace) : self
{
- $new = clone $this;
+ $new = $this;
$new->namespace = $namespace;
return $new;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L71
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function withDefaultControllerName(string $name) : self
{
- $new = clone $this;
+ $new = $this;
$new->defaultControllerName = $name;
return $new;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L82
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function withRoutePrefix(string $prefix) : self
{
- $new = clone $this;
+ $new = $this;
$new->routePrefix = $prefix;
return $new;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L106
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
continue;
}
/** @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 (!is_string($action)) {
continue;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L117
Escaped Mutant for Mutator "Continue_":
--- 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;
if (!is_string($action)) {
- continue;
+ break;
}
if (!method_exists($controllerClass, $action)) {
continue;
|
mutation / PHP 8.2-ubuntu-latest:
src/FileRouter.php#L150
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#L150
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#L170
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;
}
|