10.x backport - Inconsistent switch case syntax

Created on 13 August 2025, 1 day ago

Problem/Motivation

Nearly every switch statement in Drupal core uses the standard syntax of case followed by a colon. However, there are 14 instances where a case statement uses the alternate syntax of a semicolon instead of a colon. It seems that these were unintentional typos, since they are randomly mixed in with case statements using the standard syntax.

Moreover using semicolon is deprecated in PHP 8.5

Proposed resolution

Consistently use the standard switch case syntax.

backport
- fixes 📌 Inconsistent switch case syntax Downport
- sniffer #2901831: Only use colons in case statements

📌 Task
Status

Active

Version

10.6

Component

base system

Created by

🇫🇷France andypost

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024