Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
53 | public function __get(string $key) |
||
54 | { |
||
55 | if (isset($this->resolved[$key])) { |
||
56 | return $this->resolved[$key]; |
||
57 | } |
||
58 | |||
59 | if ($this->container->has($key) === false) { |
||
60 | throw new RuntimeException(vsprintf('Unable to resolve [ %s ].', [$key])); |
||
61 | } |
||
62 | |||
63 | $resolved = $this->container->get($key); |
||
64 | |||
65 | if ($this->container->isSingleton($key) === false) { |
||
66 | return $resolved; |
||
67 | } |
||
68 | |||
69 | return $this->resolved[$key] = $resolved; |
||
70 | } |
||
72 |