Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4cdb806

Browse files
ContainerFactory - checking for duplicate files is optional
1 parent ec5b633 commit 4cdb806

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎src/Command/CommandHelper.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public static function begin(
177177
$paths = array_map(static fn (string $path): string => $currentWorkingDirectoryFileHelper->normalizePath($currentWorkingDirectoryFileHelper->absolutizePath($path)), $paths);
178178

179179
$analysedPathsFromConfig = [];
180-
$containerFactory = new ContainerFactory($currentWorkingDirectory);
180+
$containerFactory = new ContainerFactory($currentWorkingDirectory, true);
181181
$projectConfig = null;
182182
if ($projectConfigFile !== null) {
183183
if (!is_file($projectConfigFile)) {

‎src/DependencyInjection/ContainerFactory.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ContainerFactory
4949
private string $configDirectory;
5050

5151
/** @api */
52-
public function __construct(private string $currentWorkingDirectory)
52+
public function __construct(private string $currentWorkingDirectory, privatebool$checkDuplicateFiles = false)
5353
{
5454
$this->fileHelper = new FileHelper($currentWorkingDirectory);
5555

@@ -235,6 +235,10 @@ private function detectDuplicateIncludedFiles(
235235
return $normalized;
236236
}
237237

238+
if (!$this->checkDuplicateFiles) {
239+
return $normalized;
240+
}
241+
238242
$duplicateFiles = array_unique(array_diff_key($normalized, $deduplicated));
239243

240244
throw new DuplicateIncludedFilesException($duplicateFiles);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /