We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | final class GlobalVariables |
||
8 | { |
||
9 | /** @var array */ |
||
10 | private $services; |
||
11 | |||
12 | 116 | public function __construct(array $services = []) |
|
13 | { |
||
14 | 116 | $this->services = $services; |
|
15 | 116 | } |
|
16 | |||
17 | /** |
||
18 | * @param string $name |
||
19 | * |
||
20 | * @return mixed |
||
21 | */ |
||
22 | 108 | public function get(string $name) |
|
23 | { |
||
24 | 108 | if (!isset($this->services[$name])) { |
|
25 | 1 | throw new \LogicException(\sprintf('Global variable %s could not be located. You should define it.', \json_encode($name))); |
|
26 | } |
||
27 | |||
28 | 107 | return $this->services[$name]; |
|
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param string $name |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | 1 | public function has(string $name): bool |
|
39 | } |
||
40 | } |
||
41 |