Skip to content

Commit

Permalink
ContainerFactory - always check duplicate files
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 14, 2024
1 parent f17cf9e commit 939a715
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Command/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public static function begin(
$paths = array_map(static fn (string $path): string => $currentWorkingDirectoryFileHelper->normalizePath($currentWorkingDirectoryFileHelper->absolutizePath($path)), $paths);

$analysedPathsFromConfig = [];
$containerFactory = new ContainerFactory($currentWorkingDirectory, true);
$containerFactory = new ContainerFactory($currentWorkingDirectory);
$projectConfig = null;
if ($projectConfigFile !== null) {
if (!is_file($projectConfigFile)) {
Expand Down
6 changes: 1 addition & 5 deletions src/DependencyInjection/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ContainerFactory
private static ?int $lastInitializedContainerId = null;

/** @api */
public function __construct(private string $currentWorkingDirectory, private bool $checkDuplicateFiles = false)
public function __construct(private string $currentWorkingDirectory)
{
$this->fileHelper = new FileHelper($currentWorkingDirectory);

Expand Down Expand Up @@ -277,10 +277,6 @@ private function detectDuplicateIncludedFiles(
return [$normalized, $configArray];
}

if (!$this->checkDuplicateFiles) {
return [$normalized, $configArray];
}

$duplicateFiles = array_unique(array_diff_key($normalized, $deduplicated));

throw new DuplicateIncludedFilesException($duplicateFiles);
Expand Down

0 comments on commit 939a715

Please sign in to comment.