Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6986394

Browse filesBrowse files
committed
[FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
1 parent da7deda commit 6986394
Copy full SHA for 6986394

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php
+2-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.