From 550c01b471c0deecf95647b7b48e7712623208da Mon Sep 17 00:00:00 2001 From: rbairwell Date: Tue, 27 Aug 2019 20:53:57 +0100 Subject: [PATCH] Fixes a problem with path based repositories on PHP7.4 where an attempt is made to access null as an array --- src/Composer/Repository/PathRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Repository/PathRepository.php b/src/Composer/Repository/PathRepository.php index 61ebc8d8c..20dcbcd6f 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)) { + $package['version'] = $versionData['pretty_version'] ?: 'dev-master'; + } else { + $package['version'] = 'dev-master'; + } } $output = '';