Skip to content

Commit

Permalink
Add instanceOf check
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkyle committed Aug 11, 2024
1 parent 3e6b58f commit f96cf5d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/SymfonyConsoleWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ public function __construct(protected TestRunnerInterface $testRunner) {}

public function __invoke(InputInterface $input, OutputInterface $output): int
{

$config = $input->getOption('config');
if ($config) {
$this->testRunner->setConfig($config);
if ($this->testRunner instanceof ConfigurableTestRunnerInterface) {
$config = $input->getOption('config');
if ($config) {
$this->testRunner->setConfig($config);
}

$colors = Process::isTtySupported();
$this->testRunner->useColors($colors);
}

$colors = Process::isTtySupported();
$file = $input->getArgument('file');

return ($this->testRunner->useColors($colors))($file);
return ($this->testRunner)($file);
}

}

0 comments on commit f96cf5d

Please sign in to comment.