From 6986394042f83bcace33d2fdaf88556057589029 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Sun, 15 Dec 2019 18:41:18 +0100 Subject: [PATCH] [FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported --- .../Bundle/FrameworkBundle/Command/ContainerLintCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php index 1f4ffe59af1e3..5e6277567eff3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php @@ -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 { @@ -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')); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy