mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-11 05:32:23 +00:00
Updated Rector to commit 667983116e7c8ec828a0b9b1877f90e4faf532e0
667983116e
[Transform] Transform skip() to withSkip() on RectorConfigBuilderRector (#5575)
This commit is contained in:
parent
0d0320e989
commit
af18c3962f
|
@ -73,6 +73,7 @@ CODE_SAMPLE
|
||||||
$newExpr = new StaticCall(new FullyQualified('Rector\\Config\\RectorConfig'), 'configure');
|
$newExpr = new StaticCall(new FullyQualified('Rector\\Config\\RectorConfig'), 'configure');
|
||||||
$rules = new Array_();
|
$rules = new Array_();
|
||||||
$paths = new Array_();
|
$paths = new Array_();
|
||||||
|
$skips = new Array_();
|
||||||
foreach ($stmts as $rectorConfigStmt) {
|
foreach ($stmts as $rectorConfigStmt) {
|
||||||
// complex stmts should be skipped, eg: with if else
|
// complex stmts should be skipped, eg: with if else
|
||||||
if (!$rectorConfigStmt instanceof Expression) {
|
if (!$rectorConfigStmt instanceof Expression) {
|
||||||
|
@ -97,6 +98,9 @@ CODE_SAMPLE
|
||||||
} elseif ($this->isName($rectorConfigStmt->expr->name, 'paths')) {
|
} elseif ($this->isName($rectorConfigStmt->expr->name, 'paths')) {
|
||||||
Assert::isAOf($rectorConfigStmt->expr->getArgs()[0]->value, Array_::class);
|
Assert::isAOf($rectorConfigStmt->expr->getArgs()[0]->value, Array_::class);
|
||||||
$paths = $rectorConfigStmt->expr->getArgs()[0]->value;
|
$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 {
|
} else {
|
||||||
// implementing method by method
|
// implementing method by method
|
||||||
return null;
|
return null;
|
||||||
|
@ -106,6 +110,10 @@ CODE_SAMPLE
|
||||||
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withPaths', [$paths]);
|
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withPaths', [$paths]);
|
||||||
$hasChanged = \true;
|
$hasChanged = \true;
|
||||||
}
|
}
|
||||||
|
if ($skips->items !== []) {
|
||||||
|
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withSkip', [$skips]);
|
||||||
|
$hasChanged = \true;
|
||||||
|
}
|
||||||
if ($rules->items !== []) {
|
if ($rules->items !== []) {
|
||||||
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withRules', [$rules]);
|
$newExpr = $this->nodeFactory->createMethodCall($newExpr, 'withRules', [$rules]);
|
||||||
$hasChanged = \true;
|
$hasChanged = \true;
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '5a5ea60f6dffdd0a63e04a64f8061f53facd46b3';
|
public const PACKAGE_VERSION = '667983116e7c8ec828a0b9b1877f90e4faf532e0';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2024-02-07 20:09:38';
|
public const RELEASE_DATE = '2024-02-07 20:20:49';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user