Skip to content

Commit

Permalink
Fix CommandHelper::getConfigFiles() to also include the file passed i…
Browse files Browse the repository at this point in the history
…nto it
  • Loading branch information
ondrejmirtes committed Mar 2, 2020
1 parent fcc00dc commit 5b764c7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Command/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private static function detectDuplicateIncludedFiles(
{
$neonAdapter = new NeonAdapter();
$phpAdapter = new PhpAdapter();
$allConfigFiles = $configFiles;
$allConfigFiles = [];
foreach ($configFiles as $configFile) {
$allConfigFiles = array_merge($allConfigFiles, self::getConfigFiles($neonAdapter, $phpAdapter, $configFile, $loaderParameters));
}
Expand Down Expand Up @@ -433,13 +433,12 @@ private static function getConfigFiles(
} else {
$data = $neonAdapter->load($configFile);
}
$allConfigFiles = [];
$allConfigFiles = [$configFile];
if (isset($data['includes'])) {
Validators::assert($data['includes'], 'list', sprintf("section 'includes' in file '%s'", $configFile));
$includes = Helpers::expand($data['includes'], $loaderParameters);
foreach ($includes as $include) {
$include = self::expandIncludedFile($include, $configFile);
$allConfigFiles[] = $include;
$allConfigFiles = array_merge($allConfigFiles, self::getConfigFiles($neonAdapter, $phpAdapter, $include, $loaderParameters));
}
}
Expand Down

0 comments on commit 5b764c7

Please sign in to comment.