-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect duplicate included files in ContainerFactory
- Loading branch information
1 parent
91496e1
commit f15cd6d
Showing
4 changed files
with
138 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/DependencyInjection/DuplicateIncludedFilesException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\DependencyInjection; | ||
|
||
use Exception; | ||
use function implode; | ||
use function sprintf; | ||
|
||
class DuplicateIncludedFilesException extends Exception | ||
{ | ||
|
||
/** | ||
* @param string[] $files | ||
*/ | ||
public function __construct(private array $files) | ||
{ | ||
parent::__construct(sprintf('These files are included multiple times: %s', implode(', ', $this->files))); | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getFiles(): array | ||
{ | ||
return $this->files; | ||
} | ||
|
||
} |