This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 1313 "minimum-stability" : " beta" ,
1414 "require" : {
1515 "php" : " ^5.6 || ~7.0" ,
16- "symfony/process" : " ^2.8 || ^3.1" ,
16+ "symfony/process" : " ^2.8 || ^3.1 || ^4.0 " ,
1717 "ext-curl" : " *" ,
1818 "ext-zip" : " *"
1919 },
2525 "php-mock/php-mock-phpunit" : " ^1.1" ,
2626 "php-coveralls/php-coveralls" : " ^1.0.2" ,
2727 "guzzle/guzzle" : " ^3.4.1" ,
28- "symfony/var-dumper" : " ^3.3"
28+ "symfony/var-dumper" : " ^3.3 || ^4.0 "
2929 },
3030 "autoload" : {
3131 "psr-4" : {
Original file line number Diff line number Diff line change @@ -145,11 +145,20 @@ protected static function checkExecutable($executable)
145145 */
146146 private function createProcess ()
147147 {
148- $ processBuilder = (new ProcessBuilder ())
149- ->setPrefix ($ this ->executable )
150- ->setArguments ($ this ->args )
151- ->addEnvironmentVariables ($ this ->environment );
148+ // BC: ProcessBuilder deprecated since Symfony 3.4 and removed in Symfony 4.0.
149+ if (class_exists (ProcessBuilder::class)
150+ && false === mb_strpos ('@deprecated ' , (new \ReflectionClass (ProcessBuilder::class))->getDocComment ())
151+ ) {
152+ $ processBuilder = (new ProcessBuilder ())
153+ ->setPrefix ($ this ->executable )
154+ ->setArguments ($ this ->args )
155+ ->addEnvironmentVariables ($ this ->environment );
156+
157+ return $ processBuilder ->getProcess ();
158+ }
159+ // Safe to use since Symfony 3.3
160+ $ commandLine = array_merge ([$ this ->executable ], $ this ->args );
152161
153- return $ processBuilder -> getProcess ( );
162+ return new Process ( $ commandLine , null , $ this -> environment );
154163 }
155164}
You can’t perform that action at this time.
0 commit comments