Total Complexity | 5 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | class FileDefinitionLoader implements DefinitionLoaderInterface |
||
25 | { |
||
26 | use CreateDefinitionsMethods; |
||
27 | |||
28 | private array $definitions = []; |
||
29 | |||
30 | public function __construct(string|array $definitions) |
||
31 | { |
||
32 | $services = is_string($definitions) ? require $definitions : $definitions; |
||
|
|||
33 | foreach ($services as $name => $definition) { |
||
34 | $this->definitions[$name] = $definition instanceof ObjectDefinition |
||
35 | ? $definition |
||
36 | : $this->createDefinition($definition); |
||
37 | } |
||
38 | } |
||
39 | |||
40 | |||
41 | public function getIterator(): Traversable |
||
44 | } |
||
45 | } |
||
46 |