From 38ca8857d01fba056cbe5186f50302b251b86ad5 Mon Sep 17 00:00:00 2001 From: Matt Glaman Date: Mon, 19 Oct 2020 13:59:02 -0500 Subject: [PATCH] Properly add the PHP call in Windows Fixes #180, thanks to @DanChadwick --- src/Command/CheckCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Command/CheckCommand.php b/src/Command/CheckCommand.php index 07f580e..5f28003 100644 --- a/src/Command/CheckCommand.php +++ b/src/Command/CheckCommand.php @@ -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('PHPStan path: %s', $phpstanBin), OutputInterface::VERBOSITY_DEBUG); $configuration_encoded = Neon::encode($configuration_data, Neon::BLOCK); $configuration = sys_get_temp_dir() . '/drupal_check_phpstan_' . time() . '.neon'; @@ -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'; }