Skip to content

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

@samsonasik samsonasik changed the title [Php80] Skip numeric string on ChangeSwitchToMatchRector [Php80] Skip possible numeric string on ChangeSwitchToMatchRector Nov 15, 2022
@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.

4 participants