Skip to content

[Php80] Skip possible numeric string switch cond with all integer case cond on ChangeSwitchToMatchRector #3067

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 7 commits into from
Nov 15, 2022

Conversation

samsonasik
Copy link
Member

Given the following code should be skipped:

class SkipNumericString
{
    public function run()
    {
        $hashBitsPerChar = ini_get('session.sid_bits_per_character') ?: 5;

        switch ($hashBitsPerChar) {
            case 4:
                $pattern = '#^[0-9a-f]*$#';
                break;
            case 6:
                $pattern = '#^[0-9a-zA-Z-,]*$#';
                break;
            case 5:
                // intentionally fall-through
            default:
                $pattern = '#^[0-9a-v]*$#';
                break;
        }
    }
}

see https://github.com/laminas/laminas-session/actions/runs/3473530043/jobs/5805646035#step:3:495

Verified

This commit was signed with the committer’s verified signature.
samsonasik Abdul Malik Ikhsan
@samsonasik samsonasik changed the title [Php80] Skip numeric string on ChangeSwitchToMatchRector [Php80] Skip possible numeric string on ChangeSwitchToMatchRector Nov 15, 2022
actions-user and others added 2 commits November 15, 2022 20:01

Verified

This commit was signed with the committer’s verified signature.
samsonasik Abdul Malik Ikhsan
@samsonasik samsonasik changed the title [Php80] Skip possible numeric string on ChangeSwitchToMatchRector [Php80] Skip possible numeric string switch cond with all integer case cond on ChangeSwitchToMatchRector Nov 15, 2022
@samsonasik
Copy link
Member Author

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

@TomasVotruba TomasVotruba merged commit fa9a953 into main Nov 15, 2022
@TomasVotruba TomasVotruba deleted the skip-numeric-string branch November 15, 2022 20:25
@TomasVotruba
Copy link
Member

Thank you 👍

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.

None yet

3 participants