Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | trait FactoryResolverAwareTrait |
||
14 | { |
||
15 | private ?AbstractFactory $factory = null; |
||
16 | |||
17 | public static function __callStatic(string $name, array $arguments): AbstractFactory |
||
18 | { |
||
19 | if ($name === 'factory') { |
||
20 | return (new static())->getFactory(); |
||
21 | } |
||
22 | |||
23 | throw new RuntimeException('Unknown method: ' . $name); |
||
24 | } |
||
25 | |||
26 | protected function getFactory(): AbstractFactory |
||
33 | } |
||
34 | } |
||
35 |