Skip to content

Commit

Permalink
[DX] add RectorConfig::command() to ease external command registration (
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 7, 2024
1 parent 3751c94 commit 7f2155d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,15 @@ public function collector(string $collectorClass): void
$this->tag($collectorClass, Collector::class);
}

/**
* @param class-string<Command> $commandClass
*/
public function command(string $commandClass): void
{
$this->singleton($commandClass);
$this->tag($commandClass, Command::class);
}

public function import(string $filePath): void
{
if (str_contains($filePath, '*')) {
Expand Down

0 comments on commit 7f2155d

Please sign in to comment.