Skip to content

Commit 7f2155d

Browse files
authored
[DX] add RectorConfig::command() to ease external command registration (#5443)
1 parent 3751c94 commit 7f2155d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/Config/RectorConfig.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,15 @@ public function collector(string $collectorClass): void
222222
$this->tag($collectorClass, Collector::class);
223223
}
224224

225+
/**
226+
* @param class-string<Command> $commandClass
227+
*/
228+
public function command(string $commandClass): void
229+
{
230+
$this->singleton($commandClass);
231+
$this->tag($commandClass, Command::class);
232+
}
233+
225234
public function import(string $filePath): void
226235
{
227236
if (str_contains($filePath, '*')) {

0 commit comments

Comments
 (0)