Total Complexity | 9 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class ShellVerbosityResetter |
||
11 | { |
||
12 | private $var; |
||
13 | private $env; |
||
14 | private $server; |
||
15 | |||
16 | public function __construct() |
||
17 | { |
||
18 | $this->var = \getenv('SHELL_VERBOSITY'); |
||
19 | $this->env = $_ENV['SHELL_VERBOSITY'] ?? false; |
||
20 | $this->server = $_SERVER['SHELL_VERBOSITY'] ?? false; |
||
21 | } |
||
22 | |||
23 | public function reset(): void |
||
24 | { |
||
25 | $this->resetVar(); |
||
26 | $this->resetEnv(); |
||
27 | $this->resetServer(); |
||
28 | } |
||
29 | |||
30 | private function resetVar(): void |
||
44 | } |
||
45 | |||
46 | private function resetEnv(): void |
||
56 | } |
||
57 | |||
58 | private function resetServer(): void |
||
70 |
If you suppress an error, we recommend checking for the error condition explicitly: