@@ -22,7 +22,7 @@ class PackageDiff
2222 *
2323 * @return OperationInterface[]
2424 */
25- public function getPackageDiff ($ from , $ to , $ dev = false , $ withPlatform = true )
25+ public function getPackageDiff ($ from , $ to , $ dev , $ withPlatform )
2626 {
2727 $ oldPackages = $ this ->loadPackages ($ from , $ dev , $ withPlatform );
2828 $ targetPackages = $ this ->loadPackages ($ to , $ dev , $ withPlatform );
@@ -57,7 +57,7 @@ public function getPackageDiff($from, $to, $dev = false, $withPlatform = true)
5757 *
5858 * @return ArrayRepository
5959 */
60- private function loadPackages ($ path , $ dev , $ withPlatform = true )
60+ private function loadPackages ($ path , $ dev , $ withPlatform )
6161 {
6262 $ data = \json_decode ($ this ->getFileContents ($ path ), true );
6363 $ loader = new ArrayLoader ();
@@ -91,15 +91,15 @@ private function getFileContents($path)
9191 }
9292
9393 if (filter_var ($ path , FILTER_VALIDATE_URL , FILTER_FLAG_PATH_REQUIRED ) || file_exists ($ path )) {
94- return ( string ) file_get_contents ($ path );
94+ return file_get_contents ($ path );
9595 }
9696
9797 if (false === strpos ($ originalPath , ': ' )) {
9898 $ path .= ': ' .self ::LOCKFILE ;
9999 }
100100
101101 $ output = array ();
102- @exec ('git show ' . escapeshellarg ($ path ), $ output , $ exit );
102+ @exec (sprintf ( 'git show %s 2>&1 ' , escapeshellarg ($ path) ), $ output , $ exit );
103103
104104 if (0 !== $ exit ) {
105105 throw new \RuntimeException (sprintf ('Could not open file %s or find it in git as %s ' , $ originalPath , $ path ));
0 commit comments