mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Tweak license deprecation text to handle + more gracefully, fixes #6981
This commit is contained in:
parent
20699905ab
commit
188b3a35c8
1 changed files with 6 additions and 1 deletions
|
@ -125,7 +125,12 @@ class ValidatingArrayLoader implements LoaderInterface
|
|||
foreach ($licenses as $license) {
|
||||
$spdxLicense = $licenseValidator->getLicenseByIdentifier($license);
|
||||
if ($spdxLicense && $spdxLicense[3]) {
|
||||
if (preg_match('{^[AL]?GPL-[123](\.[01])?\+?$}i', $license)) {
|
||||
if (preg_match('{^[AL]?GPL-[123](\.[01])?\+$}i', $license)) {
|
||||
$this->warnings[] = sprintf(
|
||||
'License "%s" is a deprecated SPDX license identifier, use "'.str_replace('+', '', $license).'-or-later" instead',
|
||||
$license
|
||||
);
|
||||
} elseif (preg_match('{^[AL]?GPL-[123](\.[01])?$}i', $license)) {
|
||||
$this->warnings[] = sprintf(
|
||||
'License "%s" is a deprecated SPDX license identifier, use "'.$license.'-only" or "'.$license.'-or-later" instead',
|
||||
$license
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue