1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 16:42:57 +00:00

Type annotations

This commit is contained in:
Jordi Boggiano 2021-10-16 10:16:06 +02:00
parent 626370d444
commit c3c6969cf5
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
21 changed files with 166 additions and 35 deletions

View file

@ -719,7 +719,7 @@ EOF;
$package = $item[0];
foreach (array_merge($package->getReplaces(), $package->getProvides()) as $link) {
if (preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) {
$extensionProviders[$match[1]][] = $link->getConstraint() ?: new MatchAllConstraint();
$extensionProviders[$match[1]][] = $link->getConstraint();
}
}
}
@ -736,7 +736,8 @@ EOF;
continue;
}
if ('php' === $link->getTarget() && ($constraint = $link->getConstraint())) {
if ('php' === $link->getTarget()) {
$constraint = $link->getConstraint();
if ($constraint->getLowerBound()->compareTo($lowestPhpVersion, '>')) {
$lowestPhpVersion = $constraint->getLowerBound();
}
@ -746,7 +747,7 @@ EOF;
// skip extension checks if they have a valid provider/replacer
if (isset($extensionProviders[$match[1]])) {
foreach ($extensionProviders[$match[1]] as $provided) {
if (!$link->getConstraint() || $provided->matches($link->getConstraint())) {
if ($provided->matches($link->getConstraint())) {
continue 2;
}
}