mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
Fix phpstan issues
This commit is contained in:
parent
7b273e2e25
commit
80505e745e
10 changed files with 22 additions and 12 deletions
|
@ -86,6 +86,7 @@ EOT
|
|||
if ($candidates) {
|
||||
$reqResults = array();
|
||||
foreach ($candidates as $candidate) {
|
||||
$candidateConstraint = null;
|
||||
if ($candidate->getName() === $require) {
|
||||
$candidateConstraint = new Constraint('=', $candidate->getVersion());
|
||||
$candidateConstraint->setPrettyString($candidate->getPrettyVersion());
|
||||
|
@ -98,6 +99,11 @@ EOT
|
|||
}
|
||||
}
|
||||
|
||||
// safety check for phpstan, but it should not be possible to get a candidate out of findPackagesWithReplacersAndProviders without a constraint matching $require
|
||||
if (!$candidateConstraint) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($links as $link) {
|
||||
if (!$link->getConstraint()->matches($candidateConstraint)) {
|
||||
$reqResults[] = array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue