1
0
Fork 0

Fix type warning on php8.1, refs #9770

pull/9803/head
Jordi Boggiano 2021-04-01 10:14:21 +02:00
parent dc84dbbbf7
commit 18e268556d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 1 deletions

View File

@ -343,7 +343,9 @@ EOT
} }
if (null === $stability) { if (null === $stability) {
if (preg_match('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $packageVersion, $match)) { if (null === $packageVersion) {
$stability = 'stable';
} elseif (preg_match('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $packageVersion, $match)) {
$stability = $match[1]; $stability = $match[1];
} else { } else {
$stability = VersionParser::parseStability($packageVersion); $stability = VersionParser::parseStability($packageVersion);