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 fe670dc

Browse filesBrowse files
committed
grab a service from the container only if it exists
1 parent 5f069d2 commit fe670dc
Copy full SHA for fe670dc

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7070
$clearers = [];
7171

7272
$poolNames = $input->getArgument('pools');
73-
if ($input->getOption('all')) {
73+
if ($clearAll = $input->getOption('all')) {
7474
if (!$this->poolNames) {
7575
throw new InvalidArgumentException('Could not clear all cache pools, try specifying a specific pool or cache clearer.');
7676
}
@@ -84,7 +84,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8484
foreach ($poolNames as $id) {
8585
if ($this->poolClearer->hasPool($id)) {
8686
$pools[$id] = $id;
87-
} else {
87+
} elseif (!$clearAll || $kernel->getContainer()->has($id)) {
8888
$pool = $kernel->getContainer()->get($id);
8989

9090
if ($pool instanceof CacheItemPoolInterface) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.