Skip to content
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

[CodeQuality] Handle crash attribute used on trait on CallableThisArrayToAnonymousFunctionRector #2675

Merged
merged 7 commits into from Jul 18, 2022

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Jul 17, 2022

It currently make crash:

There was 1 error:

1) Rector\Tests\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector\CallableThisArrayToAnonymousFunctionRectorTest::test with data set #9 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
Rector\Core\Exception\ShouldNotHappenException: Scope not available on "PhpParser\Node\Expr\Array_" node with parent node of "PhpParser\Node\Arg", but is required by a refactorWithScope() method of "Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector" rule. Fix scope refresh on changed nodes first

Fixes rectorphp/rector#7303

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @NotionCommotion

@samsonasik
Copy link
Member Author

PHPStan relative path notice is unrelated:

 ------------------------------------------------------------------------
  bin/rector.php:72
 ------------------------------------------------------------------------
  - '#Relative file path "vendor/autoload\.php" is not allowed, use absolute one with __DIR__#'

I added to ignoreErrors list.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba
Copy link
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit d1f9150 into main Jul 18, 2022
@TomasVotruba TomasVotruba deleted the handle-crash-callable-this-trait branch July 18, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants