Bug #91255

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php on line 314

Added by Claus Due 6 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-05-01
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In TYPO3 9.5, the ExtensionManagementUtility's `addToAllTCAtypes` method contains a loop with a switch inside. The "replace" switch cases attempts to continue to loop without providing a continuation level and this raises the above mentioned PHP warning.

foreach ($paletteNames as $paletteName) {
    // TRUNCATED EXAMPLE
    switch ($positionIdentifier) {
        case 'after':
        case 'before':
            // TRUNCATED EXAMPLE
            break;
        case 'replace':
            // TRUNCATED EXAMPLE (2 occurrences total)
                continue;
                continue;
            break;
        default:
            // Intentionally left blank
    }
}

Can be easily fixed by using `continue 2` instead of simply `continue`.


Related issues

Duplicates TYPO3 Core - Task #86589: Fix continue-statement inside a switch-block Closed 2018-10-08

History

#1 Updated by Daniel Goerz 6 months ago

  • Status changed from New to Needs Feedback

Hi Claus, looks like you are not on the latest 9.5 release as this has already been fixed with

https://review.typo3.org/c/Packages/TYPO3.CMS/+/58593
https://forge.typo3.org/issues/86589

#2 Updated by Daniel Goerz 6 months ago

  • Duplicates Task #86589: Fix continue-statement inside a switch-block added

#3 Updated by Benni Mack about 1 month ago

  • Status changed from Needs Feedback to Closed

Closing this issue now (see comment from Daniel).

Also available in: Atom PDF