Skip to content

Commit f7419bc

Browse files
committed
RouteList: $flags => $oneWay
1 parent 3059fcb commit f7419bc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Routing/RouteList.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class RouteList implements Router
1919
{
2020
protected ?self $parent;
2121

22-
/** @var array of [Router, flags] */
22+
/** @var array<array{Router, int}> */
2323
private array $list = [];
2424

2525
/** @var Router[][]|null */
@@ -136,8 +136,8 @@ public function warmupCache(): void
136136
// find best key
137137
$candidates = [];
138138
$routers = [];
139-
foreach ($this->list as [$router, $flags]) {
140-
if ($flags & self::ONE_WAY) {
139+
foreach ($this->list as [$router, $oneWay]) {
140+
if ($oneWay) {
141141
continue;
142142
} elseif ($router instanceof self) {
143143
$router->warmupCache();
@@ -187,9 +187,9 @@ public function warmupCache(): void
187187
/**
188188
* Adds a router.
189189
*/
190-
public function add(Router $router, int $flags = 0): static
190+
public function add(Router $router, int $oneWay = 0): static
191191
{
192-
$this->list[] = [$router, $flags];
192+
$this->list[] = [$router, $oneWay];
193193
$this->ranks = null;
194194
return $this;
195195
}
@@ -198,9 +198,9 @@ public function add(Router $router, int $flags = 0): static
198198
/**
199199
* Prepends a router.
200200
*/
201-
public function prepend(Router $router, int $flags = 0): void
201+
public function prepend(Router $router, int $oneWay = 0): void
202202
{
203-
array_splice($this->list, 0, 0, [[$router, $flags]]);
203+
array_splice($this->list, 0, 0, [[$router, $oneWay]]);
204204
$this->ranks = null;
205205
}
206206

@@ -225,9 +225,9 @@ protected function modify(int $index, ?Router $router): void
225225
* @param array $metadata default values or metadata
226226
* @return static
227227
*/
228-
public function addRoute(string $mask, array $metadata = [], int $flags = 0)
228+
public function addRoute(string $mask, array $metadata = [], int $oneWay = 0)
229229
{
230-
$this->add(new Route($mask, $metadata), $flags);
230+
$this->add(new Route($mask, $metadata), $oneWay);
231231
return $this;
232232
}
233233

0 commit comments

Comments
 (0)