phpcs-check-fix
Installation
SKILL.md
PHPCS Check and Fix
This project uses PHP CodeSniffer (PHPCS) with the FigLab Coding Standard (which extends the IxDF Coding Standard, built on PSR + Slevomat rules). The config lives in phpcs.xml at the project root.
Commands
- Auto-fix:
composer cs:fix— runs PHPCBF to automatically fix what it can - Check:
composer cs:check— runs PHPCS to report remaining violations
Workflow
Follow this exact sequence:
-
Run
composer cs:fixto auto-fix as many issues as possible. This handles spacing, bracket placement, import ordering, and other mechanical fixes. -
Run
composer cs:checkto see what remains. Parse the output carefully — it shows the file path, line number, error type, and the sniff name (e.g.,SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh). -
Fix remaining issues manually, one by one. The approach depends on the violation type — see the section below.