Skip to content

Commit 4cec19e

Browse files
Merge branch '3.2' into 3.3
* 3.2: [TwigBridge] Fix namespaced classes [Cache] MemcachedAdapter not working with TagAwareAdapter [DependencyInjection] Use more clear message when unused environment variables detected mix attr options between type-guess options and user options
2 parents 16ec3ea + dcec2b3 commit 4cec19e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function dump(array $options = array())
175175
}
176176
}
177177
if ($unusedEnvs) {
178-
throw new EnvParameterException($unusedEnvs);
178+
throw new EnvParameterException($unusedEnvs, null, 'Environment variables "%s" are never used. Please, check your container\'s configuration.');
179179
}
180180

181181
return $code;

Exception/EnvParameterException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*/
1919
class EnvParameterException extends InvalidArgumentException
2020
{
21-
public function __construct(array $usedEnvs, \Exception $previous = null)
21+
public function __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
}

Tests/Dumper/PhpDumperTest.php

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

337337
/**
338338
* @expectedException \Symfony\Component\DependencyInjection\Exception\EnvParameterException
339-
* @expectedExceptionMessage Incompatible use of dynamic environment variables "FOO" found in parameters.
339+
* @expectedExceptionMessage Environment variables "FOO" are never used. Please, check your container's configuration.
340340
*/
341341
public function testUnusedEnvParameter()
342342
{

0 commit comments

Comments
 (0)