[FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
This commit is contained in:
parent
da7dedaaa0
commit
6986394042
@ -80,7 +80,7 @@ final class ContainerLintCommand extends Command
|
|||||||
|
|
||||||
if (!$kernel->isDebug() || !(new ConfigCache($kernelContainer->getParameter('debug.container.dump'), true))->isFresh()) {
|
if (!$kernel->isDebug() || !(new ConfigCache($kernelContainer->getParameter('debug.container.dump'), true))->isFresh()) {
|
||||||
if (!$kernel instanceof Kernel) {
|
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 {
|
$buildContainer = \Closure::bind(function (): ContainerBuilder {
|
||||||
@ -93,7 +93,7 @@ final class ContainerLintCommand extends Command
|
|||||||
$skippedIds = [];
|
$skippedIds = [];
|
||||||
} else {
|
} else {
|
||||||
if (!$kernelContainer instanceof Container) {
|
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'));
|
(new XmlFileLoader($container = new ContainerBuilder($parameterBag = new EnvPlaceholderParameterBag()), new FileLocator()))->load($kernelContainer->getParameter('debug.container.dump'));
|
||||||
|
Reference in New Issue
Block a user