Skip to content

Conversation

@JohJohan
Copy link
Contributor

No description provided.

@JohJohan JohJohan force-pushed the StrContainsRector branch from 6e37640 to 1cf6796 Compare May 15, 2025 08:57
@JohJohan
Copy link
Contributor Author

@samsonasik note i also check for encoding param for these multibyte functions and skip if its not null value also added tests for this.

@JohJohan JohJohan requested a review from samsonasik May 15, 2025 08:59
@JohJohan JohJohan force-pushed the StrContainsRector branch from 1cf6796 to f34fb90 Compare May 15, 2025 09:39
@JohJohan JohJohan force-pushed the StrContainsRector branch from f34fb90 to 8f4f33c Compare May 15, 2025 12:01
@JohJohan JohJohan force-pushed the StrContainsRector branch from 8f4f33c to 49db14d Compare May 19, 2025 10:19
@JohJohan JohJohan requested a review from samsonasik May 19, 2025 10:20
{
public function run()
{
$isMatch = str_contains(mb_substr('happy 😊 euro €', 1), 'a');
Copy link
Member

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

Copy link
Contributor Author

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?

@JohJohan JohJohan force-pushed the StrContainsRector branch from 49db14d to 700b026 Compare May 26, 2025 09:30
@JohJohan JohJohan force-pushed the StrContainsRector branch from 700b026 to e33f105 Compare May 27, 2025 07:48
@samsonasik
Copy link
Member

@JohJohan I talked with @TomasVotruba today, and it seems it probably better to create new rule for it, but without register to php80.php set, you can create a shared service like in readonly anonymous class rule:

which share same logic for both functionality, and add condition for different rule :)

@TomasVotruba
Copy link
Member

@JohJohan Friendly ping 👍

@JohJohan
Copy link
Contributor Author

@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.

@arshidkv12 arshidkv12 mentioned this pull request Aug 29, 2025
@samsonasik
Copy link
Member

handled at PR

@JohJohan JohJohan closed this Aug 30, 2025
@JohJohan JohJohan deleted the StrContainsRector branch August 30, 2025 06:21
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.

3 participants