Updated Rector to commit 667983116e7c8ec828a0b9b1877f90e4faf532e0

667983116e [Transform] Transform skip() to withSkip() on RectorConfigBuilderRector (#5575)
This commit is contained in:
Tomas Votruba 2024-02-07 13:22:56 +00:00
parent 0d0320e989
commit af18c3962f
2 changed files with 10 additions and 2 deletions

View File

@ -73,6 +73,7 @@ CODE_SAMPLE
$newExpr = new StaticCall(new FullyQualified('Rector\\Config\\RectorConfig'), 'configure');
$rules = new Array_();
$paths = new Array_();
$skips = new Array_();
foreach ($stmts as $rectorConfigStmt) {
// complex stmts should be skipped, eg: with if else
if (!$rectorConfigStmt instanceof Expression) {
@ -97,6 +98,9 @@ CODE_SAMPLE
} elseif ($this->isName($rectorConfigStmt->expr->name, 'paths')) {
Assert::isAOf($rectorConfigStmt->expr->getArgs()[0]->value, Array_::class);
$paths = $rectorConfigStmt->expr->getArgs()[0]->value;
} elseif ($this->isName($rectorConfigStmt->expr->name, 'skip')) {
Assert::isAOf($rectorConfigStmt->expr->getArgs()[0]->value, Array_::class);
$skips = $rectorConfigStmt->expr->getArgs()[0]->value;
} else {
// implementing method by method
return null;
@ -106,6 +110,10 @@ CODE_SAMPLE
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withPaths', [$paths]);
$hasChanged = \true;
}
if ($skips->items !== []) {
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withSkip', [$skips]);
$hasChanged = \true;
}
if ($rules->items !== []) {
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withRules', [$rules]);
$hasChanged = \true;

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '5a5ea60f6dffdd0a63e04a64f8061f53facd46b3';
public const PACKAGE_VERSION = '667983116e7c8ec828a0b9b1877f90e4faf532e0';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-02-07 20:09:38';
public const RELEASE_DATE = '2024-02-07 20:20:49';
/**
* @var int
*/