Skip to content

Commit

Permalink
Updated Rector to commit 2f5a252ea9bac10994e08623e9371ec132045880
Browse files Browse the repository at this point in the history
rectorphp/rector-src@2f5a252 [DX] Make command default autotag (#5441)
  • Loading branch information
TomasVotruba committed Jan 7, 2024
1 parent dd2b386 commit 816ddfc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'c9608a0f11d8a58224b33c8d2695f210a81816bc';
public const PACKAGE_VERSION = '2f5a252ea9bac10994e08623e9371ec132045880';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-01-07 00:30:43';
public const RELEASE_DATE = '2024-01-07 13:02:42';
/**
* @var int
*/
Expand Down
18 changes: 6 additions & 12 deletions src/Config/RectorConfig.php
Expand Up @@ -17,20 +17,21 @@
use Rector\Validation\RectorConfigValidator;
use Rector\ValueObject\PhpVersion;
use Rector\ValueObject\PolyfillPackage;
use RectorPrefix202401\Symfony\Component\Console\Command\Command;
use RectorPrefix202401\Webmozart\Assert\Assert;
/**
* @api
*/
final class RectorConfig extends Container
{
/**
* @var array<class-string<RectorInterface>, mixed[]>>
* @var string[]
*/
private $ruleConfigurations = [];
private const AUTOTAG_INTERFACES = [Command::class];
/**
* @var string[]
* @var array<class-string<RectorInterface>, mixed[]>>
*/
private $autotagInterfaces = [];
private $ruleConfigurations = [];
/**
* @param string[] $paths
*/
Expand Down Expand Up @@ -310,21 +311,14 @@ 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
* @param mixed $concrete
*/
public function singleton($abstract, $concrete = null) : void
{
parent::singleton($abstract, $concrete);
foreach ($this->autotagInterfaces as $autotagInterface) {
foreach (self::AUTOTAG_INTERFACES as $autotagInterface) {
if (!\is_a($abstract, $autotagInterface, \true)) {
continue;
}
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/LazyContainerFactory.php
Expand Up @@ -262,7 +262,6 @@ public function create() : RectorConfig
$inflectorFactory = new InflectorFactory();
return $inflectorFactory->build();
});
$rectorConfig->autotagInterface(Command::class);
$rectorConfig->singleton(ProcessCommand::class);
$rectorConfig->singleton(WorkerCommand::class);
$rectorConfig->singleton(SetupCICommand::class);
Expand Down

0 comments on commit 816ddfc

Please sign in to comment.