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 26bae82

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

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

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

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

7272
$poolNames = $input->getArgument('pools');
73+
$clearAll = false;
7374
if ($input->getOption('all')) {
75+
$clearAll = true;
7476
if (!$this->poolNames) {
7577
throw new InvalidArgumentException('Could not clear all cache pools, try specifying a specific pool or cache clearer.');
7678
}
@@ -84,7 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8486
foreach ($poolNames as $id) {
8587
if ($this->poolClearer->hasPool($id)) {
8688
$pools[$id] = $id;
87-
} else {
89+
} elseif (!$clearAll || $kernel->getContainer()->has($id)) {
8890
$pool = $kernel->getContainer()->get($id);
8991

9092
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.