Skip to content

Commit

Permalink
make use of autotagInterface() (#5396)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Dec 26, 2023
1 parent 9cebe92 commit ad09d9c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/DependencyInjection/LazyContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,19 +406,21 @@ public function create(): RectorConfig
return $inflectorFactory->build();
});

$rectorConfig->tag(ProcessCommand::class, Command::class);
$rectorConfig->tag(WorkerCommand::class, Command::class);
$rectorConfig->tag(SetupCICommand::class, Command::class);
$rectorConfig->tag(ListRulesCommand::class, Command::class);
$rectorConfig->autotagInterface(Command::class);

$rectorConfig->singleton(ProcessCommand::class);
$rectorConfig->singleton(WorkerCommand::class);
$rectorConfig->singleton(SetupCICommand::class);
$rectorConfig->singleton(ListRulesCommand::class);

$rectorConfig->when(ListRulesCommand::class)
->needs('$rectors')
->giveTagged(RectorInterface::class);

// dev
if (class_exists(MissingInSetCommand::class)) {
$rectorConfig->tag(MissingInSetCommand::class, Command::class);
$rectorConfig->tag(OutsideAnySetCommand::class, Command::class);
$rectorConfig->singleton(MissingInSetCommand::class);
$rectorConfig->singleton(OutsideAnySetCommand::class);
}

$rectorConfig->alias(TypeParser::class, BetterTypeParser::class);
Expand Down

0 comments on commit ad09d9c

Please sign in to comment.