Skip to content

Commit

Permalink
Updated Rector to commit 9cebe922f18a2fd07311eab528dd59a33ff17ba4
Browse files Browse the repository at this point in the history
rectorphp/rector-src@9cebe92 [DX] Add RectorConfig::autotagInterfaces() for automated tagging of instances (#5395)
  • Loading branch information
TomasVotruba committed Dec 26, 2023
1 parent 95ed962 commit ff86091
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions packages/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ final class RectorConfig extends Container
* @var array<class-string<RectorInterface>, mixed[]>>
*/
private $ruleConfigurations = [];
/**
* @var string[]
*/
private $autotagInterfaces = [];
/**
* @param string[] $paths
*/
Expand Down Expand Up @@ -323,6 +327,27 @@ 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) {
if (!\is_a($abstract, $autotagInterface, \true)) {
continue;
}
$this->tag($abstract, $autotagInterface);
}
}
/**
* @param mixed $skipRule
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '6646d23fe0cea4b4a871ca1931e33f0cb2a574c7';
public const PACKAGE_VERSION = '9cebe922f18a2fd07311eab528dd59a33ff17ba4';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-12-26 18:37:51';
public const RELEASE_DATE = '2023-12-26 19:08:18';
/**
* @var int
*/
Expand Down

0 comments on commit ff86091

Please sign in to comment.