Skip to content

Commit

Permalink
minor #34985 [FrameworkBundle][ContainerLintCommand] Improve messages…
Browse files Browse the repository at this point in the history
… when the kernel or the container is not supported (fancyweb)

This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | #34865 (comment)
| License       | MIT
| Doc PR        | -

Minor wording suggested here #34865 (comment)

Commits
-------

6986394 [FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
  • Loading branch information
fabpot committed Dec 16, 2019
2 parents da7deda + 6986394 commit b1fd553
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -80,7 +80,7 @@ private function getContainerBuilder(): ContainerBuilder

if (!$kernel->isDebug() || !(new ConfigCache($kernelContainer->getParameter('debug.container.dump'), true))->isFresh()) {
if (!$kernel instanceof Kernel) {
throw new RuntimeException("This command does not support the console application's kernel.");
throw new RuntimeException(sprintf('This command does not support the application kernel: "%s" does not extend "%s".', \get_class($kernel), Kernel::class));
}

$buildContainer = \Closure::bind(function (): ContainerBuilder {
Expand All @@ -93,7 +93,7 @@ private function getContainerBuilder(): ContainerBuilder
$skippedIds = [];
} else {
if (!$kernelContainer instanceof Container) {
throw new RuntimeException("This command does not support the console application kernel's container.");
throw new RuntimeException(sprintf('This command does not support the application container: "%s" does not extend "%s".', \get_class($kernelContainer), Container::class));
}

(new XmlFileLoader($container = new ContainerBuilder($parameterBag = new EnvPlaceholderParameterBag()), new FileLocator()))->load($kernelContainer->getParameter('debug.container.dump'));
Expand Down

0 comments on commit b1fd553

Please sign in to comment.