-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
[PHP 8.1] Add null to string in Function Call Arg: NullToStrictStringFuncCallArgRector #6910
Comments
Another function to have strict string arg in php 8.1, preg_match_all ref https://3v4l.org/AFWHB |
Also on |
strlen as well https://3v4l.org/0s1Gs |
@samsonasik Not sure if it should be taken into account in this rector since the naming specifies
|
@tigitz could you add PR to add that on https://github.com/rectorphp/rector-src/blob/77a4582d5044446b8da43ab91a09082fa0413a23/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php#L48 ? Also better to have a fixture updated for it at https://github.com/rectorphp/rector-src/tree/main/rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture |
Are there news about managing strtotime (on other similar functions)? |
Feel free to create PR to register more functions into the list of it at https://github.com/rectorphp/rector-src/blob/992d1efc7596864c960b3a9837ebf8ee04eb159d/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php#L42-L49 |
Feature Request
There are function calls that previously allow null to be need as string, eg:
preg_split
, ref ref https://3v4l.org/lbPsJAnother use case is
preg_match
, ref https://3v4l.org/WQ1Pkthat will error on php 8.1
I think we need to have general FuncCall Rector for it, eg:
NullToStrictStringFuncCallArgRector
that can have collection of function call with args that need to be string.The text was updated successfully, but these errors were encountered: