-
-
Notifications
You must be signed in to change notification settings - Fork 431
[StrContainsRector] also replace multibyte functions fro strpos and strstr #6905
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
6e37640 to
1cf6796
Compare
|
@samsonasik note i also check for |
...Rector/NotIdentical/StrContainsRector/Fixture/offset_variable_equal_multibyte_strpos.php.inc
Outdated
Show resolved
Hide resolved
1cf6796 to
f34fb90
Compare
rules-tests/Php80/Rector/NotIdentical/StrContainsRector/Fixture/multibyte_offset_strpos.php.inc
Outdated
Show resolved
Hide resolved
f34fb90 to
8f4f33c
Compare
8f4f33c to
49db14d
Compare
| { | ||
| public function run() | ||
| { | ||
| $isMatch = str_contains(mb_substr('happy 😊 euro €', 1), 'a'); |
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 think we need specific fixture where using mb_substr is different compared to use normal substr if the position is match
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 think you mean this should differ from offset_strpos.php.inc right? I added a match for letter e and position 8 because the emoji will take more bytes than 1 so you would need the mb_ funct to do the correct match is that what you meant?
49db14d to
700b026
Compare
700b026 to
e33f105
Compare
|
@JohJohan I talked with @TomasVotruba today, and it seems it probably better to create new rule for it, but without register to which share same logic for both functionality, and add condition for different rule :) |
|
@JohJohan Friendly ping 👍 |
|
@TomasVotruba sorry for the late reply I'm busy last week's. I haven't forgotten this and will pick it up as soon as I can. |
|
handled at PR |
No description provided.