Handle missing license when showing license summary (#10537)
Fixes the issue of license summary command aborting when a package is missing license information.pull/10516/head
parent
a3e6af54f9
commit
8756f54da0
|
@ -125,7 +125,8 @@ EOT
|
||||||
$usedLicenses = array();
|
$usedLicenses = array();
|
||||||
foreach ($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
$license = $package instanceof CompletePackageInterface ? $package->getLicense() : array();
|
$license = $package instanceof CompletePackageInterface ? $package->getLicense() : array();
|
||||||
$licenseName = $license[0];
|
$licenseName = array_key_exists(0, $license) ? $license[0] : 'none';
|
||||||
|
|
||||||
if (!isset($usedLicenses[$licenseName])) {
|
if (!isset($usedLicenses[$licenseName])) {
|
||||||
$usedLicenses[$licenseName] = 0;
|
$usedLicenses[$licenseName] = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue