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 #1

Updated by Daniel Goerz over 4 years 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

Actions #2

Updated by Daniel Goerz over 4 years ago

  • Is duplicate of Task #86589: Fix continue-statement inside a switch-block added
Actions #3

Updated by Benni Mack about 4 years ago

  • Status changed from Needs Feedback to Closed

Closing this issue now (see comment from Daniel).

Actions

Also available in: Atom PDF