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

[DowngradePhp80][DowngradePhp74] Skip already has method_exists check on DowngradeReflectionGetAttributesRector + DowngradeReflectionGetTypeRector #1532

Merged
merged 5 commits into from
Dec 20, 2021

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Dec 20, 2021

Continue of #1530, if already has method_exist, no need to re-check. It currently make repetitive if in ternary:

-        if (method_exists($reflectionClass, 'getAttributes') ? $reflectionClass->getAttributes('someName', 1) : []) {
+        if (method_exists($reflectionClass, 'getAttributes') ? method_exists($reflectionClass, 'getAttributes') ? $reflectionClass->getAttributes('someName', 1) : [] : []) {

which not needed.

… on DowngradeReflectionGetAttributesRector + DowngradeReflectionGetTypeRector
@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik samsonasik enabled auto-merge (squash) December 20, 2021 13:05
@samsonasik samsonasik enabled auto-merge (squash) December 20, 2021 13:11
@samsonasik samsonasik merged commit 45e7eea into main Dec 20, 2021
@samsonasik samsonasik deleted the skip-already-method-exists branch December 20, 2021 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants