Problem/Motivation

The Coding standards project agreed to enforce a colon for the case statement.
#2999367: Require using a colon after case instruction in switch statements

Steps to reproduce

Proposed resolution

Add a sniff

Remaining tasks

Review

User interface changes

API changes

Data model changes

Comments

quietone created an issue. See original summary.

jonathan1055’s picture

A sniff and fixer for this has been written and it is part of PHP-CS-FIXER but I don't think this is currently loaded and available in Coder. What is the policy regarding installing new requirements vs writing our own sniffs?

klausi’s picture

PHP-CS-Fixer is a different system than PHPCS. Coder uses PHPCS sniffs.

Integrating or running PHP-CS-Fixer is a bit out of scope for this Coder issue, but I'm open to review approaches how we could leverage PHP-CS-Fixer as parallel system to PHPCS in Coder.

klausi’s picture

Status: Active » Closed (duplicate)
jonathan1055’s picture

I have updated #2999367: Require using a colon after case instruction in switch statements with a link to that original issue, and the fact that Coder 8.3.27 (which contains this sniff) was released on 8 Jan 2025.