1
0
Fork 0

Merge remote-tracking branch 'jderusse/optimize-compile'

pull/8986/head
Jordi Boggiano 2020-06-16 14:18:03 +02:00
commit 5aae7f4f20
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
3 changed files with 9 additions and 9 deletions

View File

@ -14,6 +14,7 @@ namespace Composer\DependencyResolver;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\Version\VersionParser; use Composer\Package\Version\VersionParser;
use Composer\Semver\CompilingMatcher;
use Composer\Semver\Constraint\ConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\Constraint; use Composer\Semver\Constraint\Constraint;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
@ -146,9 +147,7 @@ class Pool implements \Countable
$candidateVersion = $candidate->getVersion(); $candidateVersion = $candidate->getVersion();
if ($candidateName === $name) { if ($candidateName === $name) {
$pkgConstraint = new Constraint('==', $candidateVersion); if ($constraint === null || CompilingMatcher::match($constraint, Constraint::OP_EQ, $candidateVersion)) {
if ($constraint === null || $constraint->matches($pkgConstraint)) {
return true; return true;
} }

View File

@ -12,21 +12,21 @@
namespace Composer\DependencyResolver; namespace Composer\DependencyResolver;
use Composer\EventDispatcher\EventDispatcher;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\Package\Package;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\Version\StabilityFilter; use Composer\Package\Version\StabilityFilter;
use Composer\Plugin\PluginEvents;
use Composer\Plugin\PrePoolCreateEvent;
use Composer\Repository\PlatformRepository; use Composer\Repository\PlatformRepository;
use Composer\Repository\RootPackageRepository; use Composer\Repository\RootPackageRepository;
use Composer\Semver\CompilingMatcher;
use Composer\Semver\Constraint\Constraint; use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Constraint\ConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\MatchAllConstraint; use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Semver\Constraint\MultiConstraint; use Composer\Semver\Constraint\MultiConstraint;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Plugin\PrePoolCreateEvent;
use Composer\Plugin\PluginEvents;
/** /**
* @author Nils Adermann <naderman@naderman.de> * @author Nils Adermann <naderman@naderman.de>
@ -209,7 +209,7 @@ class PoolBuilder
$found = false; $found = false;
foreach ($aliasedPackages as $packageOrAlias) { foreach ($aliasedPackages as $packageOrAlias) {
if ($constraint->matches(new Constraint('==', $packageOrAlias->getVersion()))) { if (CompilingMatcher::match($constraint, Constraint::OP_EQ, $packageOrAlias->getVersion())) {
$found = true; $found = true;
} }
} }

View File

@ -23,6 +23,7 @@ use Composer\Config;
use Composer\Composer; use Composer\Composer;
use Composer\Factory; use Composer\Factory;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\Semver\CompilingMatcher;
use Composer\Util\HttpDownloader; use Composer\Util\HttpDownloader;
use Composer\Util\Loop; use Composer\Util\Loop;
use Composer\Plugin\PluginEvents; use Composer\Plugin\PluginEvents;
@ -764,7 +765,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
continue; continue;
} }
if ($constraint && !$constraint->matches(new Constraint('==', $version))) { if ($constraint && !CompilingMatcher::match($constraint, Constraint::OP_EQ, $version)) {
continue; continue;
} }