Skip to content

Commit 9c62817

Browse files
committed
refactor: remove if
1 parent 6d2cefc commit 9c62817

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

system/Router/RouteCollection.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,7 @@ public function getRoutes(?string $verb = null, bool $only = false): array
503503
if (isset($this->routes[$verb])) {
504504
// Keep current verb's routes at the beginning, so they're matched
505505
// before any of the generic, "add" routes.
506-
if (! $only) {
507-
$collection = $this->routes[$verb] + ($this->routes['*'] ?? []);
508-
} else {
509-
$collection = $this->routes[$verb];
510-
}
506+
$collection = ! $only ? $this->routes[$verb] + ($this->routes['*'] ?? []) : $this->routes[$verb];
511507

512508
foreach ($collection as $r) {
513509
$key = key($r['route']);

0 commit comments

Comments
 (0)