Problem. The framework-free binary accepts any --key with no allowlist, so --no-controler no-ops (controllers still generated, exit 0); and a typo'd subcommand like chek/generat falls through to generate, turning a read-only CI drift check into a write.
Evidence.
src/Console/StandaloneApplication.php:509-529 parse() collects every --key, never rejects.
:490-503 splitSubcommand() returns [null,argv] for an unknown first arg; run() (:49-53) defaults to runGenerate.
- Contrast
StandaloneConfigLoader.php:317-340, which does reject unknown config keys.
Fix. Build a known-flag set and throw OptionException (exit 2) on any unrecognized --flag; reject an unknown leading positional token ("Unknown command 'generat'. Did you mean 'generate'?") instead of defaulting to generate; optional levenshtein suggestion.
Done when. A typo'd flag or subcommand exits 2 with a helpful message; valid invocations unchanged.
Filed from a repo-wide improvement audit; every claim was adversarially verified against source.
Problem. The framework-free binary accepts any
--keywith no allowlist, so--no-controlerno-ops (controllers still generated, exit 0); and a typo'd subcommand likechek/generatfalls through togenerate, turning a read-only CI drift check into a write.Evidence.
src/Console/StandaloneApplication.php:509-529parse()collects every--key, never rejects.:490-503splitSubcommand()returns[null,argv]for an unknown first arg;run()(:49-53) defaults torunGenerate.StandaloneConfigLoader.php:317-340, which does reject unknown config keys.Fix. Build a known-flag set and throw
OptionException(exit 2) on any unrecognized--flag; reject an unknown leading positional token ("Unknown command 'generat'. Did you mean 'generate'?") instead of defaulting to generate; optional levenshtein suggestion.Done when. A typo'd flag or subcommand exits 2 with a helpful message; valid invocations unchanged.
Filed from a repo-wide improvement audit; every claim was adversarially verified against source.