Skip to content

Commit 1c1cfb0

Browse files
committed
refactor: rename parameter name
1 parent 3ffd7e5 commit 1c1cfb0

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

system/Router/RouteCollection.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -618,12 +618,14 @@ public function addRedirect(string $from, string $to, int $status = 302)
618618

619619
/**
620620
* Determines if the route is a redirecting route.
621+
*
622+
* @param string $routeKey routeKey or route name
621623
*/
622-
public function isRedirect(string $from): bool
624+
public function isRedirect(string $routeKey): bool
623625
{
624626
foreach ($this->routes['*'] as $name => $route) {
625627
// Named route?
626-
if ($name === $from || key($route['route']) === $from) {
628+
if ($name === $routeKey || key($route['route']) === $routeKey) {
627629
return isset($route['redirect']) && is_numeric($route['redirect']);
628630
}
629631
}
@@ -633,12 +635,14 @@ public function isRedirect(string $from): bool
633635

634636
/**
635637
* Grabs the HTTP status code from a redirecting Route.
638+
*
639+
* @param string $routeKey routeKey or route name
636640
*/
637-
public function getRedirectCode(string $from): int
641+
public function getRedirectCode(string $routeKey): int
638642
{
639643
foreach ($this->routes['*'] as $name => $route) {
640644
// Named route?
641-
if ($name === $from || key($route['route']) === $from) {
645+
if ($name === $routeKey || key($route['route']) === $routeKey) {
642646
return $route['redirect'] ?? 0;
643647
}
644648
}

system/Router/RouteCollectionInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ public function reverseRoute(string $search, ...$params);
179179
/**
180180
* Determines if the route is a redirecting route.
181181
*/
182-
public function isRedirect(string $from): bool;
182+
public function isRedirect(string $routeKey): bool;
183183

184184
/**
185185
* Grabs the HTTP status code from a redirecting Route.
186186
*/
187-
public function getRedirectCode(string $from): int;
187+
public function getRedirectCode(string $routeKey): int;
188188

189189
/**
190190
* Get the flag that limit or not the routes with {locale} placeholder to App::$supportedLocales

0 commit comments

Comments
 (0)