Skip to content

Commit

Permalink
Consider autoloaders passed in -a
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jun 24, 2022
1 parent e12b4c4 commit 78016fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Command/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ public static function begin(
}
$currentWorkingDirectoryFileHelper = new FileHelper($currentWorkingDirectory);
$currentWorkingDirectory = $currentWorkingDirectoryFileHelper->getWorkingDirectory();

/** @var array<callable>|false $autoloadFunctionsBefore */
$autoloadFunctionsBefore = spl_autoload_functions();

if ($autoloadFile !== null) {
$autoloadFile = $currentWorkingDirectoryFileHelper->absolutizePath($autoloadFile);
if (!is_file($autoloadFile)) {
Expand Down Expand Up @@ -290,9 +294,6 @@ public static function begin(
$createDir($tmpDir);
}

/** @var array<callable>|false $autoloadFunctionsBefore */
$autoloadFunctionsBefore = spl_autoload_functions();

try {
$container = $containerFactory->create($tmpDir, $additionalConfigFiles, $paths, $composerAutoloaderProjectPaths, $analysedPathsFromConfig, $level ?? self::DEFAULT_LEVEL, $generateBaselineFile, $autoloadFile, $singleReflectionFile, $singleReflectionInsteadOfFile);
} catch (InvalidConfigurationException | AssertionException $e) {
Expand Down

0 comments on commit 78016fe

Please sign in to comment.