Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit12f5636

Browse files
committed
bug#22976 [DependencyInjection] Use more clear message when unused environment variables detected (voronkovich)
This PR was squashed before being merged into the 3.2 branch (closes#22976).Discussion----------[DependencyInjection] Use more clear message when unused environment variables detected| Q | A| ------------- | ---| Branch? |3.2| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#22955| License | MITOld error message:```Incompatible use of dynamic environment variables "DATABASE_URL", "MAILER_URL" found in parameters.```New error message:```Environment variables "DATABASE_URL", "MAILER_URL" are never used. Please, check your container's configuration.```Commits-------6dbdb1b [DependencyInjection] Use more clear message when unused environment variables detected
2 parents7078cdf +6dbdb1b commit12f5636

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function dump(array $options = array())
166166
}
167167
}
168168
if ($unusedEnvs) {
169-
thrownewEnvParameterException($unusedEnvs);
169+
thrownewEnvParameterException($unusedEnvs,null,'Environment variables "%s" are never used. Please, check your container\'s configuration.');
170170
}
171171

172172
return$code;

‎src/Symfony/Component/DependencyInjection/Exception/EnvParameterException.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*/
1919
class EnvParameterExceptionextends InvalidArgumentException
2020
{
21-
publicfunction__construct(array$usedEnvs,\Exception$previous =null)
21+
publicfunction__construct(array$envs,\Exception$previous =null,$message ='Incompatible use of dynamic environment variables "%s" found in parameters.')
2222
{
23-
parent::__construct(sprintf('Incompatible use of dynamic environment variables "%s" found in parameters.',implode('", "',$usedEnvs)),0,$previous);
23+
parent::__construct(sprintf($message,implode('", "',$envs)),0,$previous);
2424
}
2525
}

‎src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public function testEnvParameter()
302302

303303
/**
304304
* @expectedException \Symfony\Component\DependencyInjection\Exception\EnvParameterException
305-
* @expectedExceptionMessageIncompatible use of dynamic environmentvariables "FOO"found in parameters.
305+
* @expectedExceptionMessageEnvironmentvariables "FOO"are never used. Please, check your container's configuration.
306306
*/
307307
publicfunctiontestUnusedEnvParameter()
308308
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp