diff --git a/src/Composer/Repository/PathRepository.php b/src/Composer/Repository/PathRepository.php index 61ebc8d8c..6e218f159 100644 --- a/src/Composer/Repository/PathRepository.php +++ b/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) && $versionData['pretty_version']) { + $package['version'] = $versionData['pretty_version']; + } else { + $package['version'] = 'dev-master'; + } } $output = '';