refactor: update code and dependencies to use Rector 2.0 with PHPStan 2.0 #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes Made and Their Sources
1. NodeTraverser::REMOVE_NODE → NodeVisitor::REMOVE_NODE
File:
src/Rules/MethodCall/RemoveMethodCallRector.phpChange:
Source:
/tmp/rector-1x/src/Rector/AbstractRector.phpline 50:return NodeTraverser::REMOVE_NODE;/tmp/rector-2x/src/Rector/AbstractRector.phpline 52:return \\PhpParser\\NodeVisitor::REMOVE_NODE;Command used to verify:
2. Removed SetListInterface Implementation
Files:
src/Set/WordPressSetList.phpsrc/Set/WordPressLevelSetList.phpChange:
Source:
find /tmp/rector-2x -name "SetListInterface.php"returned no resultsfind /tmp/rector-1x -name "SetListInterface.php"found nothing either3. configure() Parameter Type Changes
Files: All 7 configurable rules
Change:
Source:
array<mixed>parameter type/tmp/rector-2x/src/Contract/Rector/ConfigurableRectorInterface.phpline 124. ReturnFirstArgumentRector Fix
Files:
src/Rules/FuncCall/ReturnFirstArgumentRector.phpsrc/Rules/MethodCall/ReturnFirstArgumentRector.phpChange:
Source:
$node->argsisarray<Arg|VariadicPlaceholder>Argobject caused TypeError: "Cannot assign PhpParser\Node\Arg to property PhpParser\Node\Stmt\If_::$cond of type PhpParser\Node\Expr"valueproperty of Arg object which contains the actual expression5. Dependency Version Updates
File:
composer.jsonChanges:
Source:
/tmp/rector-1x/composer.jsonline 11:"phpstan/phpstan": "^1.12.5"/tmp/rector-2x/composer.jsonline 12:"phpstan/phpstan": "^2.1.26"diff -u /tmp/rector-1x/composer.json /tmp/rector-2x/composer.json6. PHPDoc Comment Preservation
File:
pint.jsonChange:
Source:
/** @var */comments to// @varcomments// @varfor type assertionsphpdoc_to_commentconverts PHPDoc blocks with only one tag to regular comments7. PHPStan Configuration Update
File:
phpstan.neonChange:
+ - '#^Method Fsylum\\RectorWordPress\\Tests\\(.*?)Test\:\:provideCases\(\) return type has no value type specified in iterable type iterable\.$#'Source:
Commands to Verify Sources
This should resolve my issue #12