From 6258b9259e7af5f062345eac3377cb1b3d7695a0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 1 Oct 2023 03:35:50 +0000 Subject: [PATCH] add same directory level search --- Config/phpstan_autoloader.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Config/phpstan_autoloader.php b/Config/phpstan_autoloader.php index 11ccea7..a05453a 100755 --- a/Config/phpstan_autoloader.php +++ b/Config/phpstan_autoloader.php @@ -53,6 +53,15 @@ function module_autoloader($class) { return; } } + + $class = \str_replace('Modules/', '/', $class); + foreach ($paths as $path) { + if (\is_file($file = $path . $class . '.php')) { + include_once $file; + + return; + } + } } spl_autoload_register('module_autoloader');