Updated Rector to commit f107b4c82435c69068a7bb93aadaa288952e9901

f107b4c824 [Rector] Allow transform sets() to withSets() on RectorConfigBuilderRector (#5638)
This commit is contained in:
Tomas Votruba 2024-02-19 16:14:10 +00:00
parent a8232e0579
commit e68f6c257d
2 changed files with 10 additions and 2 deletions

View File

@ -76,6 +76,7 @@ CODE_SAMPLE
$skips = new Array_();
$autoloadPaths = new Array_();
$bootstrapFiles = new Array_();
$sets = new Array_();
foreach ($stmts as $rectorConfigStmt) {
// complex stmts should be skipped, eg: with if else
if (!$rectorConfigStmt instanceof Expression) {
@ -118,6 +119,9 @@ CODE_SAMPLE
} elseif ($name === 'ruleWithConfiguration') {
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withConfiguredRule', [$value, $args[1]->value]);
$hasChanged = \true;
} elseif ($name === 'sets') {
Assert::isAOf($value, Array_::class);
$sets->items = \array_merge($sets->items, $value->items);
} else {
// implementing method by method
return null;
@ -143,6 +147,10 @@ CODE_SAMPLE
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withBootstrapFiles', [$bootstrapFiles]);
$hasChanged = \true;
}
if ($sets->items !== []) {
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withSets', [$sets]);
$hasChanged = \true;
}
if ($hasChanged) {
$stmt->expr = $newExpr;
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'd5c3fc753e321db315a8205ce5853ccf878b9f1e';
public const PACKAGE_VERSION = 'f107b4c82435c69068a7bb93aadaa288952e9901';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-02-19 20:21:05';
public const RELEASE_DATE = '2024-02-19 23:11:43';
/**
* @var int
*/