Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.009 |
Changes | 0 |
1 | <?php |
||
39 | 14 | public function readEnvFile(HostId $hostId): void |
|
40 | { |
||
41 | 14 | if ($this->isEnvFileAlreadyLoaded) { |
|
42 | return; |
||
43 | } |
||
44 | |||
45 | try { |
||
46 | 14 | $dotEnv = \Dotenv\Dotenv::create( |
|
47 | 14 | $this->pathResolver->resolvePathToEnvFile($hostId), |
|
48 | 14 | $this->fileNameResolver->resolveEnvFileName($hostId) |
|
49 | ); |
||
50 | 14 | $dotEnv->overload(); |
|
51 | 13 | $this->isEnvFileAlreadyLoaded = true; |
|
52 | 1 | } catch (\Dotenv\Exception\ExceptionInterface $exception) { |
|
53 | 1 | throw EnvFileReaderException::becauseEnvFileCanNotBeProcessed($exception); |
|
54 | } |
||
57 |