Skip to content

Commit

Permalink
refactor: remove unneeded $this->params
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Apr 11, 2022
1 parent 6b9aeea commit e302a3d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions system/Router/AutoRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ class AutoRouter
*/
protected string $method;

/**
* An array of params to the controller method.
*/
protected array $params = [];

/**
* Whether dashes in URI's should be converted
* to underscores when determining method names.
Expand Down Expand Up @@ -114,8 +109,11 @@ public function getRoute(string $uri): array
throw PageNotFoundException::forPageNotFound();
}

/** @var array $params An array of params to the controller method. */
$params = [];

if (! empty($segments)) {
$this->params = $segments;
$params = $segments;
}

// Ensure routes registered via $routes->cli() are not accessible via web.
Expand Down Expand Up @@ -162,7 +160,7 @@ public function getRoute(string $uri): array
);
}

return [$this->directory, $this->controllerName(), $this->methodName(), $this->params];
return [$this->directory, $this->controllerName(), $this->methodName(), $params];
}

/**
Expand Down

0 comments on commit e302a3d

Please sign in to comment.