What is wrong with that code?

Hey guys,
Phpstorm is warning me about this code here:

switch ($this->update) {
            case '1b':
            case '1b2':
            case '1stable':
            case '2.0':
            case '2.0.1':
            case '2.0.2':
            case '2.0.3':
            case '2.0.4':
            case '2.0.5':
            case '3.0':
            case 'git_1253cfa':
            case '3.0.1':
            case '3.1':
            case 'new':
                // insert new stuff only if we don't have a previous dev release
                if (!strstr($this->update, 'git_')) {

it is showing a warning in this part:
             case '3.1':

After updateKMLStructureTo3_0_1(); - I see "Expecting statement"???

And after
case '3.1':  I get expected semicolon???

The code is working and I really don't see what is wrong with it? I'll be thankfull for any explanation.

Comment actions Permalink


i have also seen strange "errormessage" in switch/case structures. I don't know if it is true - but as far as i can see, this happens when there are case-blocks that do NOT end with break.

It sems that there is an inspection for the break-statement that leads to problems...


BTW: i just ignored the messages. Most of them disappeared after saving or restarting.

Comment actions Permalink

Hey Thomas,
I think that this is a bug. I just went ahead -> added few breaks. then removed them and now I don't see that error message anymore...



Please sign in to leave a comment.