Skip to content

Commit

Permalink
fixed CS
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 16, 2019
1 parent 4165a06 commit e375887
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dotenv.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function load(string $path, string ...$extraPaths): void
* @throws FormatException when a file has a syntax error
* @throws PathException when a file does not exist or is not readable
*/
public function loadEnv(string $path, string $varName = 'APP_ENV', string $defaultEnv = 'dev', array $testEnvs = array('test')): void
public function loadEnv(string $path, string $varName = 'APP_ENV', string $defaultEnv = 'dev', array $testEnvs = ['test']): void
{
if (file_exists($path) || !file_exists($p = "$path.dist")) {
$this->load($path);
Expand All @@ -74,7 +74,7 @@ public function loadEnv(string $path, string $varName = 'APP_ENV', string $defau
}

if (null === $env = $_SERVER[$varName] ?? $_ENV[$varName] ?? null) {
$this->populate(array($varName => $env = $defaultEnv));
$this->populate([$varName => $env = $defaultEnv]);
}

if (!\in_array($env, $testEnvs, true) && file_exists($p = "$path.local")) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/DotenvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public function testEnvVarIsOverriden()
putenv('TEST_ENV_VAR_OVERRIDEN=original_value');

$dotenv = new Dotenv();
$dotenv->populate(array('TEST_ENV_VAR_OVERRIDEN' => 'new_value'), true);
$dotenv->populate(['TEST_ENV_VAR_OVERRIDEN' => 'new_value'], true);

$this->assertSame('new_value', getenv('TEST_ENV_VAR_OVERRIDEN'));
$this->assertSame('new_value', $_ENV['TEST_ENV_VAR_OVERRIDEN']);
Expand Down

0 comments on commit e375887

Please sign in to comment.