@@ -34,7 +34,11 @@ public function process(Message $message, Context $context): Result
3434 $ phpBin = (new PhpExecutableFinder ())->find ();
3535 $ consoleBin = file_exists ($ this ->projectDir .'/bin/console ' ) ? './bin/console ' : './app/console ' ;
3636
37- $ process = new Process ($ phpBin .' ' .$ consoleBin .' ' .$ this ->getCommandLine ($ command ), $ this ->projectDir );
37+ $ process = new Process (array_merge (
38+ [$ phpBin , $ consoleBin , $ command ->getCommand ()],
39+ $ command ->getArguments (),
40+ $ this ->getCommandLineOptions ($ command )
41+ ), $ this ->projectDir );
3842 $ process ->setTimeout ($ this ->timeout );
3943 $ process ->run ();
4044
@@ -48,22 +52,15 @@ public function process(Message $message, Context $context): Result
4852 }
4953
5054 /**
51- * @return string
55+ * @return string[]
5256 */
53- private function getCommandLine (RunCommand $ command ): string
57+ private function getCommandLineOptions (RunCommand $ command ): array
5458 {
55- $ optionsString = '' ;
59+ $ options = [] ;
5660 foreach ($ command ->getOptions () as $ name => $ value ) {
57- $ optionsString . = " $ name= $ value " ;
61+ $ options [] = "$ name= $ value " ;
5862 }
59- $ optionsString = trim ($ optionsString );
6063
61- $ argumentsString = '' ;
62- foreach ($ command ->getArguments () as $ value ) {
63- $ argumentsString .= " $ value " ;
64- }
65- $ argumentsString = trim ($ argumentsString );
66-
67- return trim ($ command ->getCommand ().' ' .$ argumentsString .' ' .$ optionsString );
64+ return $ options ;
6865 }
6966}
0 commit comments