Skip to content

[StrContainsRector] also replace multibyte functions fro strpos and strstr #6901

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

JohJohan
Copy link
Contributor

No description provided.

@samsonasik
Copy link
Member

Let's give it a try, thank you @JohJohan

@samsonasik samsonasik merged commit 5814187 into rectorphp:main May 14, 2025
45 checks passed
@samsonasik
Copy link
Member

@JohJohan oh, the code then need to change with new code:

if ($this->isName($funcCall->name, 'strpos') && ! $this->isIntegerZero($secondArg->value)) {
$funcCall->args[0] = new Arg($this->nodeFactory->createFuncCall(
'substr',
[$funcCall->args[0], $secondArg]
));
}

I am going to revert this first, ensure no regression...

@samsonasik
Copy link
Member

@JohJohan I am reverting at #6903

@JohJohan JohJohan deleted the StrContainsRector branch May 15, 2025 06:47
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.

2 participants