Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait ServiceCreatorTrait |
||
10 | { |
||
11 | protected function isValidFactory($factory): bool |
||
12 | { |
||
13 | return in_array( |
||
14 | ServiceFactoryInterface::class, |
||
15 | class_implements($factory) |
||
16 | ); |
||
17 | } |
||
18 | |||
19 | protected function getResolvedFactory($factory): ServiceFactoryInterface |
||
20 | { |
||
21 | return $factory instanceof ServiceFactoryInterface |
||
22 | ? $factory |
||
23 | : $factory::instance(); |
||
24 | } |
||
25 | |||
26 | protected function invalidFactoryException(string $serviceId, $found): RuntimeException |
||
33 | ); |
||
34 | } |
||
35 | } |
||
36 |