Allow setting suffix for licence name

This commit is contained in:
Joseph Bielawski
2023-09-05 20:05:09 +02:00
committed by Jerry Ma
parent 33798ff108
commit c0830a9e1f
2 changed files with 10 additions and 3 deletions

View File

@@ -90,8 +90,8 @@ class LicenseDumper
$licenses = [$licenses];
}
foreach ($licenses as $license) {
yield match ($license['type']) {
foreach ($licenses as $index => $license) {
yield ($license['suffix'] ?? $index) => match ($license['type']) {
'text' => $license['text'],
'file' => $this->loadSourceFile($source_name, $license['path'], Config::getSource($source_name)['path'] ?? null),
default => throw new RuntimeException('source [' . $source_name . '] license type is not allowed'),