phinx icon indicating copy to clipboard operation
phinx copied to clipboard

Let commands write errors to STDERR if available (fix issue 2270)

Open InvisibleSmiley opened this issue 1 year ago • 0 comments

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:

  1. creating SymfonyStyle requires both $input and $output, but some existing methods only receive $output
  2. 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".

InvisibleSmiley avatar Oct 16 '24 06:10 InvisibleSmiley