Skip to content

Router::pathTo handles custom parameters #27

Router::pathTo handles custom parameters

Router::pathTo handles custom parameters #27

Triggered via push February 27, 2024 22:11
Status Failure
Total duration 1m 40s
Artifacts
Fit to window
Zoom out
Zoom in

Annotations

5 errors and 2 warnings
build: src/Route.php#L142
Method IngeniozIT\Router\Route::extractPatterns() has parameter $where with no value type specified in iterable type array.
build: src/Route.php#L142
Method IngeniozIT\Router\Route::extractPatterns() return type has no value type specified in iterable type array.
build: src/Router.php#L112
Method IngeniozIT\Router\Router::pathTo() has parameter $parameters with no value type specified in iterable type array.
build: src/Router.php#L123
Method IngeniozIT\Router\Router::findNamedRoute() has parameter $parameters with no value type specified in iterable type array.
build
Process completed with exit code 1.
build
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
build: src/Route.php#L144
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ } private function extractPatterns(array $where, string $path) : array { - if ($this->hasParameters && str_contains($path, ':') && preg_match_all('#{(\\w+):([^}]+)}#', $path, $matches, PREG_SET_ORDER)) { + if (($this->hasParameters || str_contains($path, ':')) && preg_match_all('#{(\\w+):([^}]+)}#', $path, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { $path = str_replace($match[0], '{' . $match[1] . '}', $path); $where[$match[1]] = $match[2];