From 773635e355fc5cb59f2d6fa6b74b10b155eaabe5 Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 1 Sep 2020 12:21:36 +0100 Subject: [PATCH 1/2] ComposerRepository: avoid notice if includes do not provide a sha1 --- src/Composer/Repository/ComposerRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 649c2f115..57a95449f 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -637,7 +637,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito if (isset($data['includes'])) { foreach ($data['includes'] as $include => $metadata) { - if ($this->cache->sha1($include) === $metadata['sha1']) { + if (isset($metadata['sha1']) && $this->cache->sha1($include) === $metadata['sha1']) { $includedData = json_decode($this->cache->read($include), true); } else { $includedData = $this->fetchFile($include); From fc961dce707aeb52ba76d95253d7d70689cfbd84 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 3 Sep 2020 23:26:09 +0200 Subject: [PATCH 2/2] Call call_user_func_array() with a numeric arguments array. --- src/Composer/Autoload/ClassLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Autoload/ClassLoader.php b/src/Composer/Autoload/ClassLoader.php index fce8549f0..03b9bb9c4 100644 --- a/src/Composer/Autoload/ClassLoader.php +++ b/src/Composer/Autoload/ClassLoader.php @@ -60,7 +60,7 @@ class ClassLoader public function getPrefixes() { if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array();