Skip to content

Conversation

ogizanagi
Copy link
Contributor

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
License MIT
Doc PR N/A

Follows #20632 and updates some other places where outputting to stderr would be nice to have in order to have clean redirected outputs.

@@ -87,7 +88,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$twig = $this->getTwigEnvironment();

if (null === $twig) {
$io->error('The Twig environment needs to be set.');
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
$errorIo->error('The Twig environment needs to be set.');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this one can be challenged to simply throw a \RuntimeException instead.

@ogizanagi ogizanagi changed the title [FrameworkBundle][SecurityBundle][TwigBridge] Use stderr for some other commands [FrameworkBundle][SecurityBundle] Use stderr for some other commands Nov 28, 2016
@ogizanagi ogizanagi closed this Nov 28, 2016
@ogizanagi ogizanagi deleted the stderr_commands branch November 28, 2016 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants