From 5073e8b4de1163b29b69eba6af4a7db20420daee Mon Sep 17 00:00:00 2001 From: Paulo Esteves Date: Sat, 16 Sep 2023 12:26:33 +0100 Subject: [PATCH] refactor: Apply PHPStan rule to RouteCollection::__construct() --- system/Router/RouteCollection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/Router/RouteCollection.php b/system/Router/RouteCollection.php index 34629920cc1c..afdbe1611dea 100644 --- a/system/Router/RouteCollection.php +++ b/system/Router/RouteCollection.php @@ -302,7 +302,8 @@ public function __construct(FileLocator $locator, Modules $moduleConfig, Routing // Normalize the path string in routeFiles array. foreach ($this->routeFiles as $routeKey => $routesFile) { - $this->routeFiles[$routeKey] = realpath($routesFile) ?: $routesFile; + $realpath = realpath($routesFile); + $this->routeFiles[$routeKey] = ($realpath === false) ? $routesFile : $realpath; } }