mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Updated Rector to commit 21aa474269373c93fa8d74e72e7e8ee817a38cee
21aa474269
Fix configured rule (#5517)
This commit is contained in:
parent
5c1dd52a62
commit
7c6043c26c
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '0.19.3';
|
||||
public const PACKAGE_VERSION = '0.19.4';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-01-29 17:16:20';
|
||||
public const RELEASE_DATE = '2024-01-29 22:07:54';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -141,7 +141,7 @@ final class RectorConfig extends Container
|
||||
SimpleParameterProvider::addParameter(Option::PHPSTAN_FOR_RECTOR_PATHS, $filePaths);
|
||||
}
|
||||
/**
|
||||
* @param class-string<ConfigurableRectorInterface&RectorInterface> $rectorClass
|
||||
* @param class-string<ConfigurableRectorInterface> $rectorClass
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function ruleWithConfiguration(string $rectorClass, array $configuration) : void
|
||||
|
@ -5,6 +5,7 @@ namespace Rector\Configuration;
|
||||
|
||||
use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Contract\Rector\ConfigurableRectorInterface;
|
||||
use Rector\Contract\Rector\RectorInterface;
|
||||
use Rector\Doctrine\Set\DoctrineSetList;
|
||||
use Rector\PHPUnit\Set\PHPUnitSetList;
|
||||
@ -37,9 +38,9 @@ final class RectorConfigBuilder
|
||||
*/
|
||||
private $rules = [];
|
||||
/**
|
||||
* @var array<class-string<RectorInterface>, mixed[]>
|
||||
* @var array<class-string<ConfigurableRectorInterface>, mixed[]>
|
||||
*/
|
||||
private $rulesWithConfiguration = [];
|
||||
private $rulesWithConfigurations = [];
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
@ -127,8 +128,10 @@ final class RectorConfigBuilder
|
||||
$rectorConfig->paths($this->paths);
|
||||
$rectorConfig->skip($this->skip);
|
||||
$rectorConfig->rules($this->rules);
|
||||
foreach ($this->rulesWithConfiguration as $ruleWithConfiguration) {
|
||||
$rectorConfig->ruleWithConfiguration($ruleWithConfiguration[0], $ruleWithConfiguration[1]);
|
||||
foreach ($this->rulesWithConfigurations as $rectorClass => $configurations) {
|
||||
foreach ($configurations as $configuration) {
|
||||
$rectorConfig->ruleWithConfiguration($rectorClass, $configuration);
|
||||
}
|
||||
}
|
||||
if ($this->fileExtensions !== []) {
|
||||
$rectorConfig->fileExtensions($this->fileExtensions);
|
||||
@ -301,12 +304,12 @@ final class RectorConfigBuilder
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* @param class-string<(RectorInterface)> $rectorClass
|
||||
* @param class-string<ConfigurableRectorInterface> $rectorClass
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function withConfiguredRule(string $rectorClass, array $configuration) : self
|
||||
{
|
||||
$this->rulesWithConfiguration[$rectorClass] = $configuration;
|
||||
$this->rulesWithConfigurations[$rectorClass][] = $configuration;
|
||||
return $this;
|
||||
}
|
||||
public function withParallel(?int $timeoutSeconds = null, ?int $maxNumberOfProcess = null, ?int $jobSize = null) : self
|
||||
|
Loading…
x
Reference in New Issue
Block a user