Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
51 | 6 | private function resolveDefaultValue(string $default_value, string $variable): string |
|
52 | { |
||
53 | 6 | $value = substr($default_value, 2); |
|
54 | |||
55 | 6 | if ('?' === $default_value[1]) { |
|
56 | 2 | throw new InvalidArgumentException(sprintf('Not set variable ${%s}. %s', $variable, $value)); |
|
57 | } |
||
58 | |||
59 | 4 | if ('=' === $default_value[1]) { |
|
60 | 3 | $this->dotenv->populate( |
|
61 | $variable, |
||
62 | $value, |
||
63 | ); |
||
64 | } |
||
65 | 4 | return $value; |
|
66 | } |
||
68 |