Browse Source

Fixes a problem with path based repositories on PHP7.4 where an attempt is made to access null as an array

rbairwell 5 years ago
parent
commit
550c01b471
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/Composer/Repository/PathRepository.php

+ 5 - 1
src/Composer/Repository/PathRepository.php

@@ -155,7 +155,11 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn
 
             if (!isset($package['version'])) {
                 $versionData = $this->versionGuesser->guessVersion($package, $path);
-                $package['version'] = $versionData['pretty_version'] ?: 'dev-master';
+                if (is_array($versionData)) {
+                    $package['version'] = $versionData['pretty_version'] ?: 'dev-master';
+                } else {
+                    $package['version'] = 'dev-master';
+                }
             }
 
             $output = '';