Problem
check --generate-baseline is an action disguised as an option. When the flag is present, Check::execute takes a completely different code path: it calls Runner::baseline() instead of Runner::run(), prints no violations, and always returns SUCCESS. So check doesn't actually "check" anything in that mode — the command has two responsibilities hidden behind one verb.
This is also inconsistent with the rest of the CLI: other actions (init, debug:expression) are already standalone commands.
Proposal
Introduce a dedicated command, with an optional filename argument:
phparkitect generate-baseline [filename]
- Defaults to
phparkitect-baseline.json when no filename is given (same as today).
- Shares the relevant options with
check (--config, --autoload, --ignore-baseline-linenumbers), probably by extracting the common option definitions into a base command or trait.
Migration: fail fast with a clear error
Generating a baseline is a one-off, manual operation — it shouldn't appear in any CI workflow. So instead of a soft deprecation period, check --generate-baseline should fail immediately with a clear error pointing to the new command:
Error: the --generate-baseline option has been moved to its own command.
Run: phparkitect generate-baseline [filename]
Keeping the option defined (but failing) is deliberate: simply removing it would make Symfony Console exit with a generic "option does not exist" error, which is far less helpful. The failing stub can then be dropped entirely in a later release.
Problem
check --generate-baselineis an action disguised as an option. When the flag is present,Check::executetakes a completely different code path: it callsRunner::baseline()instead ofRunner::run(), prints no violations, and always returnsSUCCESS. Socheckdoesn't actually "check" anything in that mode — the command has two responsibilities hidden behind one verb.This is also inconsistent with the rest of the CLI: other actions (
init,debug:expression) are already standalone commands.Proposal
Introduce a dedicated command, with an optional filename argument:
phparkitect-baseline.jsonwhen no filename is given (same as today).check(--config,--autoload,--ignore-baseline-linenumbers), probably by extracting the common option definitions into a base command or trait.Migration: fail fast with a clear error
Generating a baseline is a one-off, manual operation — it shouldn't appear in any CI workflow. So instead of a soft deprecation period,
check --generate-baselineshould fail immediately with a clear error pointing to the new command:Keeping the option defined (but failing) is deliberate: simply removing it would make Symfony Console exit with a generic "option does not exist" error, which is far less helpful. The failing stub can then be dropped entirely in a later release.