Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0175 |
Changes | 0 |
1 | <?php |
||
17 | 2 | public function load($env = '.env') |
|
18 | { |
||
19 | |||
20 | 2 | if (!file_exists($env)) { |
|
21 | throw new \RuntimeException("Invalid ENV file or file is not readable"); |
||
22 | } |
||
23 | |||
24 | 2 | $content = file_get_contents($env); |
|
25 | 2 | $values = explode("\n", str_replace(array("\r\n", "\n\r", "\r"), "\n", $content)); |
|
26 | |||
27 | 2 | foreach ($values AS $value) { |
|
28 | 2 | $this->parse($value); |
|
29 | } |
||
30 | |||
31 | 2 | return $this; |
|
32 | } |
||
58 |