Rename variable for clarity
parent
ae44a5963d
commit
668655c21a
|
@ -96,9 +96,9 @@ EOT
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'json':
|
case 'json':
|
||||||
$dependencies = array();
|
$usedLicenses = array();
|
||||||
foreach ($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
$dependencies[$package->getPrettyName()] = array(
|
$usedLicenses[$package->getPrettyName()] = array(
|
||||||
'version' => $package->getFullPrettyVersion(),
|
'version' => $package->getFullPrettyVersion(),
|
||||||
'license' => $package->getLicense(),
|
'license' => $package->getLicense(),
|
||||||
);
|
);
|
||||||
|
@ -108,23 +108,23 @@ EOT
|
||||||
'name' => $root->getPrettyName(),
|
'name' => $root->getPrettyName(),
|
||||||
'version' => $root->getFullPrettyVersion(),
|
'version' => $root->getFullPrettyVersion(),
|
||||||
'license' => $root->getLicense(),
|
'license' => $root->getLicense(),
|
||||||
'dependencies' => $dependencies,
|
'dependencies' => $usedLicenses,
|
||||||
)));
|
)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'summary':
|
case 'summary':
|
||||||
$dependencies = array();
|
$usedLicenses = array();
|
||||||
foreach ($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
$license = $package->getLicense();
|
$license = $package->getLicense();
|
||||||
$licenseName = $license[0];
|
$licenseName = $license[0];
|
||||||
if (!isset($dependencies[$licenseName])) {
|
if (!isset($usedLicenses[$licenseName])) {
|
||||||
$dependencies[$licenseName] = 0;
|
$usedLicenses[$licenseName] = 0;
|
||||||
}
|
}
|
||||||
$dependencies[$licenseName]++;
|
$usedLicenses[$licenseName]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows = array();
|
$rows = array();
|
||||||
foreach ($dependencies as $usedLicense => $numberOfDependencies) {
|
foreach ($usedLicenses as $usedLicense => $numberOfDependencies) {
|
||||||
$rows[] = array($usedLicense, $numberOfDependencies);
|
$rows[] = array($usedLicense, $numberOfDependencies);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue