| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 19 | public function __invoke() |
||
| 20 | { |
||
| 21 | $filePath = rtrim($this->kernel->getRootPath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '.env'; |
||
| 22 | |||
| 23 | $envLoader = new Loader($filePath); |
||
| 24 | if ($this->kernel->isCli()) { |
||
| 25 | // todo: Load different env fire for each environment. |
||
| 26 | $env = (new ArgvInput)->getParameterOption(['--env', '-e']); |
||
| 27 | if ($env) { |
||
| 28 | $envLoader->setEnvironmentVariable('APP_ENV', $env); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | } |