New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Remove RectifiedNode value object for RectifiedAnalyzer #3079
Conversation
All checks have passed 🎉 @TomasVotruba it is ready for review. |
dc5fe77
to
3cc4355
Compare
Rebased. |
PHPStan notice is unrelated; Run vendor/bin/phpstan
Note: Using configuration file /home/runner/work/rector-src/rector-src/phpstan.neon.
0/394 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0%
394/394 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Error: Ignored error pattern #Parameter \#1 \$class of method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo<PHPStan\\PhpDocParser\\Ast\\Node\>\:\:(.*?)\(\) expects class\-string, string given# was not matched in reported errors.
-- ---------------------------------------------------------------------------
Error
-- ---------------------------------------------------------------------------
Ignored error pattern #Parameter \#1 \$class of method
Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo<PHPStan\\PhpDocParser\
\Ast\\Node>\:\:(.*?)\(\) expects class\-string, string given# was not
matched in reported errors. |
Ok, the PHPStan notice seems can be ignored. |
It seems the PHPStan notice in rector-symfony: ➜ rector-symfony git:(main) composer phpstan
> vendor/bin/phpstan analyse --ansi --error-format symplify
! [NOTE] The Xdebug PHP extension is active, but "--xdebug" is not used. This may
! slow down performance and the process will not halt at breakpoints.
Note: Using configuration file /Users/samsonasik/www/rector-symfony/phpstan.neon.
394/394 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[WARNING] Ignored error pattern #Parameter \#1 \$class of method
Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo<PHPStan\\PhpDocParser\</>
Ast\\Node>\:\:(.*?)\(\) expects class\-string, string given# was not
matched in reported errors.
Script vendor/bin/phpstan analyse --ansi --error-format symplify handling the phpstan event returned with error code 1 |
PHPStan notice fixed at rectorphp/rector-symfony#277 |
Restart build. |
All checks have passed 🎉 @TomasVotruba I think it is ready. |
…ass-string<RectorInterface> for created by rule attribute
… $node === $originalNode
I found that phpstan_cache_printer check not really needed, only verify against Expr is enough 👍 099c914 |
@TomasVotruba Finally 🎉 🎉 🎉 , I found the real solution, after |
All checks have passed 🎉 🎉 🎉 @TomasVotruba I think it is ready 🎉 🎉 🎉 |
I added test to prove that existing |
457f385
to
9561e66
Compare
I also added test fixture to prove |
a67e13e
to
ea43357
Compare
All checks have passed 🎉 🎉 🎉 @TomasVotruba I think it is ready 🎉 🎉 🎉 |
Thank you 👍😊 It looks like a lot of effort, great job 👌 Feel free to merge when ready 👍 |
With consecutive last passed Rector rule correctly handled at PR:
The
RectifiedNode
value object that previously used to save last previously run Rector rule no longer needed, so it can be removedhttps://github.com/rectorphp/rector-src/pull/3079/files#diff-5c5469b5b3ba8256b58b9d9bf66fe5873b03597965174036968f5b0d1513a565
It require verify phpstan_cache_printer attribute exists to decorate attribute CREATED_BY_RULE when refactor() call returns null.It require connect refactored Node with existing
Node
s for previous and next node.By this, we finally get rid of unnecessary save
Node
andRector
rule into object as it already inCREATED_BY_RULE
🎉 🎉 🎉