Total Complexity | 7 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 93.75% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Injectors extends AbstractCollection implements InjectorInterface |
||
15 | { |
||
16 | 6 | public function __construct(array $members) |
|
17 | { |
||
18 | 6 | parent::__construct($members); |
|
19 | 6 | if (0 === $this->count()) { |
|
20 | throw new InvalidArgumentException('There are no injectors in the collection'); |
||
21 | } |
||
22 | 6 | } |
|
23 | |||
24 | 6 | public function isValidMember(mixed $member): bool |
|
25 | { |
||
26 | 6 | return ($member instanceof InjectorInterface); |
|
27 | } |
||
28 | |||
29 | 3 | public function validate(): void |
|
30 | { |
||
31 | 3 | foreach ($this->getIterator() as $injector) { |
|
32 | 3 | $injector->validate(); |
|
33 | } |
||
34 | 3 | } |
|
35 | |||
36 | 3 | public function inject(Repository $repository, LoggerInterface $logger): int |
|
43 | } |
||
44 | } |
||
45 |