-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
[Transform] Check str_contains * before fnmatch() early on AddAllowDynamicPropertiesAttributeRector #4991
Conversation
…cPropertiesAttributeRector
All checks have passed 🎉 @TomasVotruba I am merging it ;) |
if (str_contains($transformOnNamespace, '*')) { | ||
if (! fnmatch($transformOnNamespace, $className, FNM_NOESCAPE)) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomasVotruba @staabm this conditions seems need to be on last resort to check because it returns true on negation early, I will create separate PR to cover too late check.
} | ||
|
||
if ($this->nodeNameResolver->isStringName($className, $transformOnNamespace)) { | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be return true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm actually I am not sure. is this area covered by tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to add new fixture to cover this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not, it need to be processed as exists
@TomasVotruba @staabm here based on #4980 (comment)