Skip to content

Commit

Permalink
Use stderr for outputing warnings instead of stdout
Browse files Browse the repository at this point in the history
This fixes phpstorm integration, which cannot currrently correctly detect behat version because of output that's mixed with the output in this extension.
  • Loading branch information
ostrolucky committed Sep 17, 2024
1 parent 4cb7284 commit b5110f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
Expand Down Expand Up @@ -186,6 +187,10 @@ public function process(ContainerBuilder $container): void
/** @var OutputInterface $output */
$output = $container->get(CliExtension::OUTPUT_ID);

if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}

$filterConfig = $container->getParameter('behat.code_coverage.config.filter');
$branchPathConfig = $container->getParameter('behat.code_coverage.config.branchAndPathCoverage');
$cacheDir = $container->getParameter('behat.code_coverage.config.cache');
Expand Down

0 comments on commit b5110f2

Please sign in to comment.