@@ -417,9 +417,7 @@ public function getDiff($revisions)
417
417
*/
418
418
public function getSize ()
419
419
{
420
- $ commandlineArguments = array ('du ' , '-skc ' , $ this ->gitDir );
421
- $ commandline = $ this ->normalizeCommandlineArguments ($ commandlineArguments );
422
- $ process = new Process ($ commandline );
420
+ $ process = new Process (array ('du ' , '-skc ' , $ this ->gitDir ));
423
421
$ process ->run ();
424
422
425
423
if (!preg_match ('/(\d+)\s+total$/ ' , trim ($ process ->getOutput ()), $ vars )) {
@@ -621,47 +619,11 @@ private function getProcess($command, $args = array())
621
619
622
620
$ base [] = $ command ;
623
621
624
- $ commandlineArguments = array_merge ($ base , $ args );
625
- $ commandline = $ this ->normalizeCommandlineArguments ($ commandlineArguments );
626
-
627
- $ process = new Process ($ commandline );
622
+ $ process = new Process (array_merge ($ base , $ args ));
628
623
$ process ->setEnv ($ this ->environmentVariables );
629
624
$ process ->setTimeout ($ this ->processTimeout );
630
625
$ process ->setIdleTimeout ($ this ->processTimeout );
631
626
632
627
return $ process ;
633
628
}
634
-
635
- /**
636
- * This internal helper method is used to convert an array of commandline
637
- * arguments to an escaped commandline string for older versions of the
638
- * Symfony Process component.
639
- *
640
- * It acts as a backward compatible layer for Symfony Process < 3.3.
641
- *
642
- * @param array $arguments a list of command line arguments
643
- *
644
- * @return string|array a single escaped string (< 4.0) or a raw array of
645
- * the arguments passed in (4.0+)
646
- *
647
- * @see Process::escapeArgument()
648
- * @see ProcessUtils::escapeArgument()
649
- */
650
- private function normalizeCommandlineArguments (array $ arguments )
651
- {
652
- // From version 4.0 and onwards, the Process accepts an array of
653
- // arguments, and escaping is taken care of automatically.
654
- if (!class_exists ('Symfony\Component\Process\ProcessBuilder ' )) {
655
- return $ arguments ;
656
- }
657
-
658
- // For version < 3.3, the Process only accepts a simple string
659
- // as commandline, and escaping has to happen manually.
660
- $ commandline = implode (' ' , array_map (
661
- 'Symfony\Component\Process\ProcessUtils::escapeArgument ' ,
662
- $ arguments
663
- ));
664
-
665
- return $ commandline ;
666
- }
667
629
}
0 commit comments