From f1b2f8af8570b6554e5ed19e6627d81b64658e26 Mon Sep 17 00:00:00 2001 From: GeekZebre Date: Thu, 28 Mar 2019 14:35:32 +0100 Subject: [PATCH 1/3] Launch shell_exec on Windows --- src/Command/Helper/Parsers.php | 2 +- src/Command/Test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Command/Helper/Parsers.php b/src/Command/Helper/Parsers.php index 6d06453d..2eb4b59b 100644 --- a/src/Command/Helper/Parsers.php +++ b/src/Command/Helper/Parsers.php @@ -64,7 +64,7 @@ public function getParsers(InputInterface $input, OutputInterface $output, bool $args[] = '--benchmark'; } - $result = shell_exec($parserDir->getPathname() . '/parse.sh ' . implode(' ', $args)); + $result = shell_exec('sh ' .$parserDir->getPathname() . '/parse.sh ' . implode(' ', $args)); if ($result !== null) { $result = trim($result); diff --git a/src/Command/Test.php b/src/Command/Test.php index 5994999b..8b7e54a3 100644 --- a/src/Command/Test.php +++ b/src/Command/Test.php @@ -123,7 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->write('Generating data for the ' . $testName . ' test suite... '); $this->results[$testName] = []; - $testOutput = trim((string) shell_exec($testData['path'] . '/build.sh')); + $testOutput = trim((string) shell_exec( 'sh '. $testData['path'] . '/build.sh')); file_put_contents($expectedDir . '/' . $testName . '.json', $testOutput); From 06a1ab34d433e4844c431f6706a113849ca91361 Mon Sep 17 00:00:00 2001 From: GeekZebre Date: Thu, 28 Mar 2019 15:42:26 +0100 Subject: [PATCH 2/3] Pretty Fix --- src/Command/Helper/Parsers.php | 2 +- src/Command/Test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Command/Helper/Parsers.php b/src/Command/Helper/Parsers.php index 2eb4b59b..a7d11f09 100644 --- a/src/Command/Helper/Parsers.php +++ b/src/Command/Helper/Parsers.php @@ -64,7 +64,7 @@ public function getParsers(InputInterface $input, OutputInterface $output, bool $args[] = '--benchmark'; } - $result = shell_exec('sh ' .$parserDir->getPathname() . '/parse.sh ' . implode(' ', $args)); + $result = shell_exec('sh ' . $parserDir->getPathname() . '/parse.sh ' . implode(' ', $args)); if ($result !== null) { $result = trim($result); diff --git a/src/Command/Test.php b/src/Command/Test.php index 8b7e54a3..144430e5 100644 --- a/src/Command/Test.php +++ b/src/Command/Test.php @@ -123,7 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->write('Generating data for the ' . $testName . ' test suite... '); $this->results[$testName] = []; - $testOutput = trim((string) shell_exec( 'sh '. $testData['path'] . '/build.sh')); + $testOutput = trim((string) shell_exec('sh ' . $testData['path'] . '/build.sh')); file_put_contents($expectedDir . '/' . $testName . '.json', $testOutput); From 67c8cccbe89127c97243d2063c2b74232724e619 Mon Sep 17 00:00:00 2001 From: GeekZebre Date: Fri, 29 Mar 2019 08:18:01 +0100 Subject: [PATCH 3/3] Update psalm-baseline.xml Update psalm-baseline.xml to take care of new shell_exec calls. --- psalm-baseline.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 29626889..03d295f7 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -42,12 +42,12 @@ - shell_exec($parserDir->getPathname() . '/parse.sh ' . implode(' ', $args)) + shell_exec('sh ' . $parserDir->getPathname() . '/parse.sh ' . implode(' ', $args)) - shell_exec($testData['path'] . '/build.sh') + shell_exec('sh ' . $testData['path'] . '/build.sh')