Skip to content

Commit

Permalink
Properly add the PHP call in Windows
Browse files Browse the repository at this point in the history
Fixes #180, thanks to @DanChadwick
  • Loading branch information
mglaman authored Oct 19, 2020
1 parent 42d28c8 commit 38ca885
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Command/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}

if (substr(PHP_OS, 0, 3) == 'WIN') {
$phpstanBin = "php $phpstanBin";
}

$output->writeln(sprintf('<comment>PHPStan path: %s</comment>', $phpstanBin), OutputInterface::VERBOSITY_DEBUG);
$configuration_encoded = Neon::encode($configuration_data, Neon::BLOCK);
$configuration = sys_get_temp_dir() . '/drupal_check_phpstan_' . time() . '.neon';
Expand All @@ -233,6 +229,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'--error-format=' . $input->getOption('format')
];

if (substr(PHP_OS, 0, 3) == 'WIN') {
array_unshift($command, 'php');
}

if ($input->getOption('no-progress')) {
$command[] = '--no-progress';
}
Expand Down

0 comments on commit 38ca885

Please sign in to comment.