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] Skip different value left and right on SimplifyEmptyArrayCheckRector #2998

Merged
merged 14 commits into from
Oct 17, 2022

Conversation

samsonasik
Copy link
Member

Comment on lines +149 to +152
// skip same line that cause infinite loop
if ($rangeLine === 0) {
return null;
}
Copy link
Member Author

@samsonasik samsonasik Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the following code:

if ($node->expr instanceof FuncCall) {
    return ! $node->expr->isFirstClassCallable() && $this->isName($node->expr, 'array_filter') && isset($node->expr->args[0]);
}

it cause infinite loop during extracting && operator to each stmt and add new line after it, this handle it.

@samsonasik
Copy link
Member Author

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

@TomasVotruba
Copy link
Member

Thank you 👍

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.

SimplifyEmptyArrayCheckRector checks unrelated variable for empty array
4 participants