Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Oct 24, 2024
1 parent 6c899f4 commit 74b697c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Attributes/Topics.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
class Topics extends \Consolidation\AnnotatedCommand\Attributes\Topics
{
}
3 changes: 2 additions & 1 deletion src/Commands/core/ImageFlushCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ protected function interact(InputInterface $input, OutputInterface $output): voi

public function execute(InputInterface $input, OutputInterface $output): int
{
$io = new DrushStyle($input, $output);

if ($input->getOption('all')) {
$input->setArgument('style_names', array_keys($this->entityTypeManager->getStorage('image_style')->loadMultiple()));
}
Expand All @@ -72,7 +74,6 @@ public function execute(InputInterface $input, OutputInterface $output): int
$ids = StringUtils::csvToArray($input->getArgument('style_names'));
foreach ($this->entityTypeManager->getStorage('image_style')->loadMultiple($ids) as $style_name => $style) {
$style->flush();
$io = new DrushStyle($input, $output);
$io->success("Image style $style_name flushed");
}
return static::SUCCESS;
Expand Down
5 changes: 5 additions & 0 deletions src/Runtime/DependencyInjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Drush\Symfony\DrushStyleInjector;
use League\Container\Container;
use League\Container\ContainerInterface;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Robo\Robo;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -166,6 +167,10 @@ protected function alterServicesForDrush($container, Application $application, I
$paramInjection = $container->get('parameterInjection');
$paramInjection->register('Symfony\Component\Console\Style\SymfonyStyle', new DrushStyleInjector());

// Alias the dispatcher service that is defined in \Robo\Robo::configureContainer.
Robo::addShared($container, EventDispatcherInterface::class, 'eventDispatcher'); // For autowiring


// Add our own callback to the hook manager
$hookManager = $container->get('hookManager');
$hookManager->addCommandEvent(new GlobalOptionsEventListener());
Expand Down

0 comments on commit 74b697c

Please sign in to comment.