Skip to content

Commit ff85b54

Browse files
minor #746 Clarify the dump-env exception message (apfelbox)
This PR was merged into the 1.12-dev branch. Discussion ---------- Clarify the dump-env exception message `--env` would be an option, but `env` is an argument. And the suggested/hinted ```bash composer dump-env --env=prod ``` doesn't work Commits ------- dd2aea1 Clarify the dump-env exception message
2 parents d7cd877 + dd2aea1 commit ff85b54

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Command/DumpEnvCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private function loadEnv(string $path, ?string $env): array
108108
}
109109

110110
if (!$env) {
111-
throw new \RuntimeException('Please provide the name of the environment either by using the "--env" command line argument or by defining the "APP_ENV" variable in the ".env.local" file.');
111+
throw new \RuntimeException('Please provide the name of the environment either by passing it as command line argument or by defining the "APP_ENV" variable in the ".env.local" file.');
112112
}
113113

114114
if (method_exists($dotenv, 'loadEnv')) {

tests/Command/DumpEnvCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function testRequiresToSpecifyEnvArgumentWhenLocalFileDoesNotSpecifyAppEn
131131

132132
$command = $this->createCommandDumpEnv();
133133
$this->expectException(\RuntimeException::class);
134-
$this->expectExceptionMessage('Please provide the name of the environment either by using the "--env" command line argument or by defining the "APP_ENV" variable in the ".env.local" file.');
134+
$this->expectExceptionMessage('Please provide the name of the environment either by passing it as command line argument or by defining the "APP_ENV" variable in the ".env.local" file.');
135135

136136
try {
137137
$command->execute([]);

0 commit comments

Comments
 (0)