phinx
phinx copied to clipboard
Let commands write errors to STDERR if available (fix issue 2270)
Fixes #2270.
In the end I chose to copy/adapt OutputStyle::getErrorOutput as a new protected method on the abstract command rather than using SymfonyStyle because:
- creating SymfonyStyle requires both $input and $output, but some existing methods only receive $output
- SymfonyStyle behaves differently than the plain OutputStyle, which might introduce new issues
I also fixed the exit code for the case where no aliases exist, applying the rule "error output -> exit code 1".