Skip to content

Commit

Permalink
Simplifies loading ENV variables from dotenv.
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Aug 16, 2023
1 parent d7c8048 commit 5c94261
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Bridge/Dotenv/src/Bootloader/DotenvBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Spiral\DotEnv\Bootloader;

use Dotenv\Dotenv;
use Spiral\Boot\AbstractKernel;
use Spiral\Boot\Bootloader\Bootloader;
use Spiral\Boot\DirectoriesInterface;
use Spiral\Boot\EnvironmentInterface;
Expand All @@ -15,10 +14,10 @@ final class DotenvBootloader extends Bootloader
private bool $init = false;

public function init(
AbstractKernel $kernel,
DirectoriesInterface $dirs
DirectoriesInterface $dirs,
EnvironmentInterface $env,
): void {
$kernel->running(fn (EnvironmentInterface $env) => $this->loadEnvVariables($dirs, $env));
$this->loadEnvVariables($dirs, $env);

Check warning on line 20 in src/Bridge/Dotenv/src/Bootloader/DotenvBootloader.php

View check run for this annotation

Codecov / codecov/patch

src/Bridge/Dotenv/src/Bootloader/DotenvBootloader.php#L20

Added line #L20 was not covered by tests
}

public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void
Expand Down

0 comments on commit 5c94261

Please sign in to comment.