From c8ee93bcb57b4997052a556c1098bfb154c2255c Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Fri, 23 Sep 2022 10:17:34 +0200 Subject: [PATCH] [+]: "PhpCodeParser" -> try to fix autoload issue #11 --- src/voku/SimplePhpParser/Parsers/PhpCodeParser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/voku/SimplePhpParser/Parsers/PhpCodeParser.php b/src/voku/SimplePhpParser/Parsers/PhpCodeParser.php index dee6af2..2a1ba3d 100644 --- a/src/voku/SimplePhpParser/Parsers/PhpCodeParser.php +++ b/src/voku/SimplePhpParser/Parsers/PhpCodeParser.php @@ -78,15 +78,15 @@ public static function getPhpFiles( array $fileExtensions = [] ): ParserContainer { foreach ($autoloaderProjectPaths as $projectPath) { - if (\file_exists($projectPath . '/vendor/autoload.php')) { + if (\file_exists($projectPath) && \is_file($projectPath)) { + /** @noinspection PhpIncludeInspection */ + require_once $projectPath; + } elseif (\file_exists($projectPath . '/vendor/autoload.php')) { /** @noinspection PhpIncludeInspection */ require_once $projectPath . '/vendor/autoload.php'; } elseif (\file_exists($projectPath . '/../vendor/autoload.php')) { /** @noinspection PhpIncludeInspection */ require_once $projectPath . '/../vendor/autoload.php'; - } elseif (\file_exists($projectPath) && \is_file($projectPath)) { - /** @noinspection PhpIncludeInspection */ - require_once $projectPath; } } \restore_error_handler();