Skip to content

Commit

Permalink
Fix image:flush --all (#5702)
Browse files Browse the repository at this point in the history
* Fix image:flush --all

* Actually use postInit
  • Loading branch information
weitzman committed Jul 10, 2023
1 parent 33939f1 commit bb61946
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Commands/core/ImageCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function flush($style_names, $options = ['all' => false]): void
}

#[CLI\Hook(type: HookManager::INTERACT, target: self::FLUSH)]
public function interactFlush($input, $output): void
public function interactFlush(InputInterface $input, $output): void
{
$styles = array_keys(ImageStyle::loadMultiple());
$style_names = $input->getArgument('style_names');
Expand All @@ -56,10 +56,10 @@ public function interactFlush($input, $output): void
}
}

#[CLI\Hook(type: HookManager::INITIALIZE, target: self::FLUSH)]
public function initFlush(InputInterface $input, AnnotationData $annotationData): void
#[CLI\Hook(type: HookManager::POST_INITIALIZE, target: self::FLUSH)]
public function postInit(InputInterface $input, AnnotationData $annotationData): void
{
// Needed for non-interactive calls.
// Needed for non-interactive calls.We use post-init phase because interact() methods run early
if ($input->getOption('all')) {
$styles = array_keys(ImageStyle::loadMultiple());
$input->setArgument('style_names', implode(",", $styles));
Expand Down

0 comments on commit bb61946

Please sign in to comment.