Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DefinedRouteCollector.php to use RouteCollectionInterface #8206

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions system/Router/DefinedRouteCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/
final class DefinedRouteCollector
{
private RouteCollection $routeCollection;
private RouteCollectionInterface $routeCollection;

public function __construct(RouteCollection $routes)
public function __construct(RouteCollectionInterface $routes)
{
$this->routeCollection = $routes;
}
Expand All @@ -47,17 +47,17 @@
];

foreach ($methods as $method) {
$routes = $this->routeCollection->getRoutes($method);

Check failure on line 50 in system/Router/DefinedRouteCollector.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Method CodeIgniter\Router\RouteCollectionInterface::getRoutes() invoked with 1 parameter, 0 required.

foreach ($routes as $route => $handler) {
if (is_string($handler) || $handler instanceof Closure) {
if ($handler instanceof Closure) {
$view = $this->routeCollection->getRoutesOptions($route, $method)['view'] ?? false;

Check failure on line 55 in system/Router/DefinedRouteCollector.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Call to an undefined method CodeIgniter\Router\RouteCollectionInterface::getRoutesOptions().

$handler = $view ? '(View) ' . $view : '(Closure)';
}

$routeName = $this->routeCollection->getRoutesOptions($route, $method)['as'] ?? $route;

Check failure on line 60 in system/Router/DefinedRouteCollector.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Call to an undefined method CodeIgniter\Router\RouteCollectionInterface::getRoutesOptions().

yield [
'method' => $method,
Expand Down
Loading