Skip to content

Commit 6c6cddb

Browse files
[FrameworkBundle] Empty event dispatcher earlier in CacheClearCommand
1 parent 1f1e28a commit 6c6cddb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Command/CacheClearCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
111111
$io->comment(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
112112
$this->cacheClearer->clear($realCacheDir);
113113

114+
// The current event dispatcher is stale, let's not use it anymore
115+
$this->getApplication()->setDispatcher(new EventDispatcher());
116+
114117
if ($input->getOption('no-warmup')) {
115118
$this->filesystem->rename($realCacheDir, $oldCacheDir);
116119
} else {
@@ -129,9 +132,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
129132

130133
$this->filesystem->remove($oldCacheDir);
131134

132-
// The current event dispatcher is stale, let's not use it anymore
133-
$this->getApplication()->setDispatcher(new EventDispatcher());
134-
135135
if ($output->isVerbose()) {
136136
$io->comment('Finished');
137137
}

0 commit comments

Comments
 (0)