1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 01:22:54 +00:00

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

This commit is contained in:
rbairwell 2019-08-27 20:53:57 +01:00
parent bfba228b5a
commit 550c01b471

View file

@ -155,7 +155,11 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn
if (!isset($package['version'])) { if (!isset($package['version'])) {
$versionData = $this->versionGuesser->guessVersion($package, $path); $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 = ''; $output = '';