Total Complexity | 5 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class ContainerBagLocator |
||
10 | { |
||
11 | /** |
||
12 | * @var ContainerBagInterface |
||
13 | */ |
||
14 | private static $bag; |
||
15 | |||
16 | /** |
||
17 | * @param ContainerInterface $container |
||
18 | */ |
||
19 | 7 | public static function init(ContainerInterface $container): void |
|
26 | 7 | } |
|
27 | |||
28 | /** |
||
29 | * @return ContainerBagInterface |
||
30 | */ |
||
31 | 7 | public static function get(): ContainerBagInterface |
|
32 | { |
||
33 | 7 | if (self::$bag === null) { |
|
34 | 1 | throw new \LogicException('ContainerBagLocator has not been initialized.'); |
|
35 | } |
||
36 | |||
37 | 6 | return self::$bag; |
|
38 | } |
||
39 | |||
40 | 8 | public static function flush(): void |
|
43 | 8 | } |
|
44 | } |
||
45 |