Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | final class Container |
||
14 | { |
||
15 | 10 | private function __construct( |
|
16 | private GacelaContainer $gacelaContainer, |
||
17 | ) { |
||
18 | 10 | } |
|
19 | |||
20 | 17 | public function get(string $id): mixed |
|
21 | { |
||
22 | 17 | return $this->gacelaContainer->get($id); |
|
23 | } |
||
24 | |||
25 | 9 | public function set(string $id, mixed $instance): void |
|
28 | } |
||
29 | |||
30 | 10 | public static function withConfig(Config $config): self |
|
31 | { |
||
32 | 10 | return new self( |
|
33 | 10 | new GacelaContainer( |
|
34 | 10 | $config->getFactory()->createGacelaFileConfig()->getMappingInterfaces(), |
|
35 | 10 | $config->getSetupGacela()->getServicesToExtend(), |
|
36 | 10 | ), |
|
37 | 10 | ); |
|
38 | } |
||
39 | |||
40 | 1 | public function getLocator(): Locator |
|
43 | } |
||
44 | } |
||
45 |