Total Complexity | 3 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | class OperationFactory implements OperationFactoryInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var ContainerBuilder |
||
24 | */ |
||
25 | private static $container; |
||
26 | private static $isContainerInitialised = false; |
||
27 | |||
28 | /** |
||
29 | * @throws \Exception |
||
30 | */ |
||
31 | 150 | public static function create(string $operationClass): Operation |
|
32 | { |
||
33 | 150 | if (false === self::$isContainerInitialised) { |
|
34 | 1 | self::initialiseContainer(); |
|
35 | } |
||
36 | |||
37 | 150 | return self::$container->get($operationClass); |
|
|
|||
38 | } |
||
39 | |||
40 | /** |
||
41 | * |
||
42 | * @throws \Exception |
||
43 | */ |
||
44 | 1 | private static function initialiseContainer(): void |
|
54 | 1 | } |
|
55 | } |
||
56 |