| Total Complexity | 6 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | #[Singleton] |
||
| 13 | final class FileLoaderRegistry |
||
| 14 | { |
||
| 15 | 575 | public function __construct( |
|
| 16 | /**@var array<non-empty-string, FileLoaderInterface> */ |
||
| 17 | private array $loaders = [], |
||
| 18 | 575 | ) {} |
|
| 19 | |||
| 20 | /** |
||
| 21 | * @param non-empty-string $ext |
||
|
|
|||
| 22 | */ |
||
| 23 | 29 | public function register(string $ext, FileLoaderInterface $loader): void |
|
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | 517 | public function getExtensions(): array |
|
| 31 | { |
||
| 32 | 517 | return \array_keys($this->loaders); |
|
| 33 | } |
||
| 34 | |||
| 35 | 470 | public function getLoader(string $ext): FileLoaderInterface |
|
| 38 | } |
||
| 39 | } |