Kuba Werłos 6 лет назад
Родитель
Сommit
50dd7d9f9f

+ 1 - 1
composer.json

@@ -37,7 +37,7 @@
     "require-dev": {
         "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0",
         "justinrainbow/json-schema": "^5.0",
-        "keradus/cli-executor": "^1.1",
+        "keradus/cli-executor": "^1.2",
         "mikey179/vfsStream": "^1.6",
         "php-coveralls/php-coveralls": "^2.1",
         "php-cs-fixer/accessible-object": "^1.0",

+ 4 - 4
src/Linter/ProcessLinterProcessBuilder.php

@@ -41,10 +41,10 @@ final class ProcessLinterProcessBuilder
      */
     public function build($path)
     {
-        return new Process(sprintf(
-            '"%s" -l "%s"',
+        return new Process([
             $this->executable,
-            $path
-        ));
+            '-l',
+            $path,
+        ]);
     }
 }

+ 3 - 3
tests/Linter/ProcessLinterProcessBuilderTest.php

@@ -29,8 +29,8 @@ final class ProcessLinterProcessBuilderTest extends TestCase
      * @param string $file
      * @param string $expected
      *
-     * @testWith ["php", "foo.php", "\"php\" -l \"foo.php\""]
-     *           ["C:\\Program Files\\php\\php.exe", "foo bar\\baz.php", "\"C:\\Program Files\\php\\php.exe\" -l \"foo bar\\baz.php\""]
+     * @testWith ["php", "foo.php", "'php' '-l' 'foo.php'"]
+     *           ["C:\\Program Files\\php\\php.exe", "foo bar\\baz.php", "'C:\\Program Files\\php\\php.exe' '-l' 'foo bar\\baz.php'"]
      * @requires OS Linux|Darwin
      */
     public function testPrepareCommandOnPhpOnLinuxOrMac($executable, $file, $expected)
@@ -48,7 +48,7 @@ final class ProcessLinterProcessBuilderTest extends TestCase
      * @param string $file
      * @param string $expected
      *
-     * @testWith ["php", "foo.php", "\"php\" -l \"foo.php\""]
+     * @testWith ["php", "foo.php", "php -l foo.php"]
      *           ["C:\\Program Files\\php\\php.exe", "foo bar\\baz.php", "\"C:\\Program Files\\php\\php.exe\" -l \"foo bar\\baz.php\""]
      * @requires OS ^Win
      */