summaryrefslogtreecommitdiffstats
path: root/550c01b471c0deecf95647b7b48e7712623208da.patch
blob: f5dd9715fdab30ea0ae28bf622403a6f3c4cb0a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 550c01b471c0deecf95647b7b48e7712623208da Mon Sep 17 00:00:00 2001
From: rbairwell <rbairwell@users.noreply.github.com>
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 61ebc8d8cd3c..20dcbcd6faa0 100644
--- a/src/Composer/Repository/PathRepository.php
+++ b/src/Composer/Repository/PathRepository.php
@@ -155,7 +155,11 @@ protected function initialize()
 
             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 = '';