Skip to content
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

[Php81] Handle crash insensitive function name on NullToStrictStringFuncCallArgRector #2953

Merged
merged 5 commits into from
Sep 24, 2022

Conversation

samsonasik
Copy link
Member

Given the following code:

final class CaseInsensitiveFunctionName
{
    public function run($var)
    {
        return strToLower($var);
    }
}

It currently make crash:

There was 1 error:

1) Rector\Tests\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector\NullToStrictStringFuncCallArgRectorTest::test with data set #14 ('/Users/samsonasik/www/rector-...hp.inc')
Undefined array key "strToLower"

/Users/samsonasik/www/rector-src/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php:488
/Users/samsonasik/www/rector-src/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php:334

This PR fix it.

Fixes rectorphp/rector#7504

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @noximo

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit 429c9c0 into main Sep 24, 2022
@TomasVotruba TomasVotruba deleted the crash-insensitive-function-name branch September 24, 2022 08: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
3 participants