What is wrong with that code?

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

switch ($this->update) {
            case '1b':
                hotspotsInstallerFiles::dropToolbars();
                updateFiles();
                hotspotsInstallerDatabase::updateSettings1b();
            case '1b2':
                hotspotsInstallerFiles::updateFilesBeta2();
            case '1stable':
                hotspotsInstallerFiles::updateFiles1stable();
                hotspotsInstallerDatabase::updateSettings1stable();
            case '2.0':
            case '2.0.1':
            case '2.0.2':
            case '2.0.3':
            case '2.0.4':
                hotspotsInstallerDatabase::updateSettings204();
            case '2.0.5':
                hotspotsInstallerDatabase::updateDatabaseStructure205();
            case '3.0':
                hotspotsInstallerFiles::updateFilesTo3_0();
                hotspotsInstallerDatabase::updateDatabaseStructureTo3_0();
                hotspotsInstallerDatabase::updateSettingsTo3_0();
                hotspotsInstallerDatabase::updateMenuTo3_0();
            case 'git_1253cfa':
            case '3.0.1':
                hotspotsInstallerDatabase::updateKMLStructureTo3_0_1();
            case '3.1':
                hotspotsInstallerDatabase::updateCategoriesTiles3_1();
                break;
            case 'new':
                // insert new stuff only if we don't have a previous dev release
                if (!strstr($this->update, 'git_')) {
                    hotspotsInstallerDatabase::insertNewSettings();
                }
                break;
        }

it is showing a warning in this part:
hotspotsInstallerDatabase::updateKMLStructureTo3_0_1();
             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.

2 comments
Comment actions Permalink

Hi,

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...

Thomas

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

0
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...

Strange...
Daniel

0

Please sign in to leave a comment.