8000 [DependencyInjection] Use more clear message when unused environment variables detected by voronkovich · Pull Request #22976 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DependencyInjection] Use more clear message when unused environment variables detected #22976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Return back old arguments order to avoid BC break
  • Loading branch information
voronkovich committed Jun 3, 2017
commit 9e77f0dd553bb6b9bd7b68b2c5e452970e02df1e
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function compile(ContainerBuilder $container)
} while ($prev = $prev->getPrevious());

if ($usedEnvs) {
$e = new EnvParameterException($usedEnvs, 'Incompatible use of dynamic environment variables "%s" found in parameters.', $e);
$e = new EnvParameterException($usedEnvs, $e);
}

throw $e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function dump(array $options = array())
}
}
if ($unusedEnvs) {
throw new EnvParameterException($unusedEnvs, 'Environment variables "%s" are never used. Please, check your container\'s configuration.');
throw new EnvParameterException($unusedEnvs, null, 'Environment variables "%s" are never used. Please, check your container\'s configuration.');
}

return $code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class EnvParameterException extends InvalidArgumentException
{
public function __construct(array $envs, $message, \Exception $previous = null)
public function __construct(array $envs, \Exception $previous = null, $message = 'Incompatible use of dynamic environment variables "%s" found in parameters.')
{
parent::__construct(sprintf($message, implode('", "', $envs)), 0, $previous);
}
Expand Down
0