From ec6e05d55fd783757baa3f33cb904e10d861632b Mon Sep 17 00:00:00 2001 From: Jonas Drieghe Date: Tue, 23 Jun 2020 19:44:12 +0200 Subject: [PATCH] Sort licenses so that the most used license will appear first --- src/Composer/Command/LicensesCommand.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/Command/LicensesCommand.php b/src/Composer/Command/LicensesCommand.php index 9140aa48d..ce1e3a390 100644 --- a/src/Composer/Command/LicensesCommand.php +++ b/src/Composer/Command/LicensesCommand.php @@ -123,6 +123,9 @@ EOT $usedLicenses[$licenseName]++; } + // Sort licenses so that the most used license will appear first + arsort($dependencies, SORT_NUMERIC); + $rows = array(); foreach ($usedLicenses as $usedLicense => $numberOfDependencies) { $rows[] = array($usedLicense, $numberOfDependencies);