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

findEndOfStatement problems #1885

Closed
GrahamLab opened this issue Feb 8, 2018 · 2 comments
Closed

findEndOfStatement problems #1885

GrahamLab opened this issue Feb 8, 2018 · 2 comments
Milestone

Comments

@GrahamLab
Copy link

GrahamLab commented Feb 8, 2018

Hi
Given this code

switch ($m[self::META_IDX_FORMAT][0]) {
    case 1: {
        throw new OutOfRangeException();
        break;
    }

    default: {
        // throw new LogicException("Format of '{$f}' is unknown: {$m[self::META_IDX_FORMAT]}");
        throw new OutOfRangeException();
        break;
    }
}

If I issue a findEndOfStatement using the index of the first case statement I get the closing brace of the default branch which seems not to make any sense

Please can someone provide an explanation

@michalbundyra
Copy link
Contributor

@GrahamLab See #1863. I think it's the same issue, but good to have another failing example.

@gsherwood gsherwood added this to the 3.3.0 milestone Mar 16, 2018
gsherwood added a commit that referenced this issue Mar 16, 2018
@gsherwood
Copy link
Member

This did turn out to be the same bug as #1863, so it is fixed in 3.3.0. I've added unit tests for this specific case as well. Thanks for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants