Skip to content

Commit 900d859

Browse files
committed
Use stderr for maintainer sponsorship messages
Fixes #270 and allows piping checkstyle output to file
1 parent 0d812c4 commit 900d859

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/Command/CheckCommand.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Symfony\Component\Console\Input\InputArgument;
1010
use Symfony\Component\Console\Input\InputInterface;
1111
use Symfony\Component\Console\Input\InputOption;
12+
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1213
use Symfony\Component\Console\Output\OutputInterface;
1314
use Symfony\Component\Process\Process;
1415

@@ -262,14 +263,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
262263

263264
$output->writeln('<comment>Return PHPStan exit code</comment>', OutputInterface::VERBOSITY_DEBUG);
264265

265-
$output->writeln('Thanks for using <info>drupal-check</info>!');
266-
$output->writeln('');
267-
$output->writeln('Consider sponsoring the development of the maintainers which make <options=bold>drupal-check</> possible:');
268-
$output->writeln('');
269-
$output->writeln('- <options=bold>phpstan (ondrejmirtes)</>: https://github.com/sponsors/ondrejmirtes');
270-
$output->writeln('- <options=bold>phpstan-deprecation-rules (ondrejmirtes))</>: https://github.com/sponsors/ondrejmirtes');
271-
$output->writeln('- <options=bold>phpstan-drupal (mglaman))</>: https://github.com/sponsors/mglaman');
272-
$output->writeln('- <options=bold>drupal-check (mglaman))</>: https://github.com/sponsors/mglaman');
266+
if ($output instanceof ConsoleOutputInterface) {
267+
$stderr = $output->getErrorOutput();
268+
$stderr->writeln('Thanks for using <info>drupal-check</info>!');
269+
$stderr->writeln('');
270+
$stderr->writeln('Consider sponsoring the development of the maintainers which make <options=bold>drupal-check</> possible:');
271+
$stderr->writeln('');
272+
$stderr->writeln('- <options=bold>phpstan (ondrejmirtes)</>: https://github.com/sponsors/ondrejmirtes');
273+
$stderr->writeln('- <options=bold>phpstan-deprecation-rules (ondrejmirtes))</>: https://github.com/sponsors/ondrejmirtes');
274+
$stderr->writeln('- <options=bold>phpstan-drupal (mglaman))</>: https://github.com/sponsors/mglaman');
275+
$stderr->writeln('- <options=bold>drupal-check (mglaman))</>: https://github.com/sponsors/mglaman');
276+
}
273277

274278
return $process->getExitCode();
275279
}

0 commit comments

Comments
 (0)