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 | https://github.com/symfony/symfony/pull/34865#discussion_r357968601
| License | MIT
| Doc PR | -
Minor wording suggested here https://github.com/symfony/symfony/pull/34865#discussion_r357968601
Commits
-------
6986394042
[FrameworkBundle][ContainerLintCommand] Improve messages when the kernel or the container is not supported
This commit is contained in:
commit
b1fd5538ad
@ -80,7 +80,7 @@ final class ContainerLintCommand extends Command
|
||||
|
||||
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 @@ final class ContainerLintCommand extends Command
|
||||
$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'));
|
||||
|
Reference in New Issue
Block a user