8000 minor #34985 [FrameworkBundle][ContainerLintCommand] Improve messages… · symfony/symfony@b1fd553 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1fd553

Browse files
committed
minor #34985 [FrameworkBundle][ContainerLintCommand] Improve messages 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
2 parents da7deda + 6986394 commit b1fd553

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private function getContainerBuilder(): ContainerBuilder
8080

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

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

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

0 commit comments

Comments
 (0)
0