Skip to content

Commit

Permalink
Revert "[DX] Make command default autotag" (#5442)
Browse files Browse the repository at this point in the history
* Revert "[DX] Make command default autotag (#5441)"

This reverts commit 2f5a252.

* make command default
  • Loading branch information
TomasVotruba committed Jan 7, 2024
1 parent 2f5a252 commit 3751c94
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
final class RectorConfig extends Container
{
/**
* @var string[]
* @var array<class-string<RectorInterface>, mixed[]>>
*/
private const AUTOTAG_INTERFACES = [Command::class];
private array $ruleConfigurations = [];

/**
* @var array<class-string<RectorInterface>, mixed[]>>
* @var string[]
*/
private array $ruleConfigurations = [];
private array $autotagInterfaces = [Command::class];

/**
* @param string[] $paths
Expand Down Expand Up @@ -380,14 +380,22 @@ public function disableCollectors(): void
SimpleParameterProvider::setParameter(Option::COLLECTORS, false);
}

/**
* @internal Use to add tag on service registrations
*/
public function autotagInterface(string $interface): void
{
$this->autotagInterfaces[] = $interface;
}

/**
* @param string $abstract
*/
public function singleton($abstract, mixed $concrete = null): void
{
parent::singleton($abstract, $concrete);

foreach (self::AUTOTAG_INTERFACES as $autotagInterface) {
foreach ($this->autotagInterfaces as $autotagInterface) {
if (! is_a($abstract, $autotagInterface, true)) {
continue;
}
Expand Down

0 comments on commit 3751c94

Please sign in to comment.