code-style
Checks and fixes code style issues using EasyCodingStandard and Composer Normalize.
Description
The code-style
command orchestrates code style checking and fixing using:
composer update --lock --quiet- updates lock filecomposer normalize- normalizes composer.json formatvendor/bin/ecs- EasyCodingStandard for PHP code style
Usage
composer code-style
composer dev-tools code-style
composer code-style --fix
composer dev-tools:fix code-style
vendor/bin/dev-tools code-style [options]
Options
--fix, -f- Automatically fix code style issues. Without this option, ECS runs in dry-run mode.
--progress- Enable progress output from ECS.
--json- Emit a structured machine-readable payload instead of the normal terminal output.
--pretty-json- Emit the same structured payload with indentation for terminal inspection.
Examples
Check code style (dry-run):
composer code-style
Fix code style automatically:
composer code-style --fix
composer dev-tools:fix code-style
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success. All checks passed or fixes applied. |
| 1 | Failure. Style issues found or fix failed. |
Behavior
- Always runs
composer update --lock --quietfirst. - Composer Normalize runs in
--dry-runmode unless--fixis specified. - ECS uses local
ecs.phpwhen present, otherwise falls back to packaged default. - Progress output is disabled by default; use
--progressto re-enable it in text mode. --jsonand--pretty-jsonforward JSON mode to ECS and suppress its progress bar so the structured payload stays machine-readable.- The command executes processes in sequence via ProcessQueue.