Skip to content

Commit bd143d5

Browse files
committed
[FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
1 parent 95498f2 commit bd143d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)