Skip to content

Commit 7f817fd

Browse files
committed
refactor: remove if
1 parent 2ea49af commit 7f817fd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

system/Router/AutoRouterImproved.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ public function getRoute(string $uri): array
114114
$segments = explode('/', $uri);
115115

116116
// Check for Module Routes.
117-
if ($routingConfig = config(Routing::class)) {
118-
if (array_key_exists($segments[0], $routingConfig->moduleRoutes)) {
119-
$uriSegment = array_shift($segments);
120-
121-
$this->namespace = rtrim($routingConfig->moduleRoutes[$uriSegment], '\\') . '\\';
122-
}
117+
if (
118+
($routingConfig = config(Routing::class))
119+
&& array_key_exists($segments[0], $routingConfig->moduleRoutes)
120+
) {
121+
$uriSegment = array_shift($segments);
122+
$this->namespace = rtrim($routingConfig->moduleRoutes[$uriSegment], '\\') . '\\';
123123
}
124124

125125
// WARNING: Directories get shifted out of the segments array.

0 commit comments

Comments
 (0)