Browse Source

Merge pull request #7756 from glaubinix/f/undefined-index-preprocess

VcsRepository: fix undefined index notice in preProcess
Jordi Boggiano 6 năm trước cách đây
mục cha
commit
5d92eea170
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/Composer/Repository/VcsRepository.php

+ 2 - 1
src/Composer/Repository/VcsRepository.php

@@ -295,7 +295,8 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
     protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
     {
         // keep the name of the main identifier for all packages
-        $data['name'] = $this->packageName ?: $data['name'];
+        $dataPackageName = isset($data['name']) ? $data['name'] : null;
+        $data['name'] = $this->packageName ?: $dataPackageName;
 
         if (!isset($data['dist'])) {
             $data['dist'] = $driver->getDist($identifier);