Project

General

Profile

Actions

Bug #91255

closed

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 over 4 years ago. Updated about 4 years ago.

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

0%

Estimated time:
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 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Task #86589: Fix continue-statement inside a switch-blockClosedStefan Neufeind2018-10-08

Actions
Actions

Also available in: Atom PDF