-
-
Notifications
You must be signed in to change notification settings - Fork 431
Add test case for converting null integer parameters to integers #7612
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
Conversation
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.
@codebymikey could you provide a patch as well, you should can change this
rector-src/rules/Php81/Rector/FuncCall/NullToStrictIntPregSlitFuncCallLimitArgRector.php
Line 128 in a458869
| if (! $this->isName($funcCall, 'preg_split')) { |
with isNames() and array() of function names:
- if (! $this->isName($funcCall, 'preg_split')) {
+ if (! $this->isNames($funcCall, [
'preg_split',
'preg_grep',
'preg_match',
// and so on...
])) {|
Wouldn't it be more flexible to create a new That way the same rule may be easily used for custom projects. Also, is it fine to remove |
Sounds best way. We'll still need to have it configured in the PHP set.
Keep the class, but remove the |
|
This should similar implementation with
|
|
@codebymikey Just checking, any progress on this? We usually close long-opened failing PRs with issues to avoid stalling. |
|
None I'm afraid as I haven't had the time to look into it, I just created the failing text fixture file as requested in the original issue, and added my thoughts regarding how a fix should be tackled. |
|
I see. @samsonasik provided clear context to fix it. Feel free reopen with fixing PR 👌 |
Fixes rectorphp/rector#9483