From f17998b71c8e24598433b1f535a53f344d5a1d45 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 1 Oct 2023 16:07:56 +0000 Subject: [PATCH] fix autoloading --- Config/phpstan_autoloader.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Config/phpstan_autoloader.php b/Config/phpstan_autoloader.php index 72ec45a..1591239 100755 --- a/Config/phpstan_autoloader.php +++ b/Config/phpstan_autoloader.php @@ -12,7 +12,7 @@ function module_autoloader($class) { __DIR__ . '/../../MainRepository/Resources/', __DIR__ . '/../../MainRepository/Resources/tcpdf/', __DIR__ . '/../../MainRepository/Resources/Stripe/', - __DIR__ . '/../../src', + __DIR__ . '/../../src/', __DIR__ . '/../../../', ]; @@ -55,11 +55,32 @@ function module_autoloader($class) { } } + + foreach ($paths as $path) { + if (($file = \realpath($path . 'oms-' . $class2 . '.php'))) { + include_once $file; + + return; + } elseif (($file = \realpath($file = $path . 'oms-' . $class3 . '.php')) && \stripos($file, $class2) !== false) { + include_once $file; + + return; + } elseif (\is_file($file = $path . 'oms-' . $class . '.php')) { + include_once $file; + + return; + } + } + $class = \str_replace('Modules/', '/', $class); foreach ($paths as $path) { if (\is_file($file = $path . $class . '.php')) { include_once $file; + return; + } elseif (\is_file($file = $path . 'oms-' . $class . '.php')) { + include_once $file; + return; } }