Skip to content

Commit

Permalink
[+]: "PhpCodeParser" -> try to fix autoload
Browse files Browse the repository at this point in the history
issue #11
  • Loading branch information
Lars Moelleken committed Sep 23, 2022
1 parent 9275289 commit c8ee93b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/voku/SimplePhpParser/Parsers/PhpCodeParser.php
Expand Up @@ -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();
Expand Down

0 comments on commit c8ee93b

Please sign in to comment.