Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | public function get(string $name): string |
||
29 | { |
||
30 | if (class_exists($name)) { |
||
31 | // we received class name instead of the alias |
||
32 | return $name; |
||
33 | } |
||
34 | |||
35 | if (array_key_exists($name, $this->container)) { |
||
36 | // alias exists returning the class name |
||
37 | return $this->container[$name]; |
||
38 | } |
||
39 | |||
40 | throw new AliasDoesNotExistException($name); |
||
41 | } |
||
43 |