1
0
Fork 0

Update to MatchAllConstraint

pull/8923/head
Jordi Boggiano 2020-05-21 16:12:41 +02:00
parent 17fa85d7c2
commit c7fb15faf4
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
5 changed files with 12 additions and 13 deletions

10
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "4661f272e877e4aaaaf1cf0848b891b7",
"content-hash": "aaa28d3c716a6b5d973347f4046f4931",
"packages": [
{
"name": "composer/ca-bundle",
@ -83,12 +83,12 @@
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
"reference": "07a3e324e654298714fcecfbb4604e3ee0c6f3bd"
"reference": "7401fc3628694736b1cac8ec8d5c7dfdcfe54ea6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/07a3e324e654298714fcecfbb4604e3ee0c6f3bd",
"reference": "07a3e324e654298714fcecfbb4604e3ee0c6f3bd",
"url": "https://api.github.com/repos/composer/semver/zipball/7401fc3628694736b1cac8ec8d5c7dfdcfe54ea6",
"reference": "7401fc3628694736b1cac8ec8d5c7dfdcfe54ea6",
"shasum": ""
},
"require": {
@ -156,7 +156,7 @@
"type": "tidelift"
}
],
"time": "2020-05-20T08:27:54+00:00"
"time": "2020-05-21T14:08:19+00:00"
},
{
"name": "composer/spdx-licenses",

View File

@ -20,7 +20,7 @@ use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Semver\Constraint\Bound;
use Composer\Semver\Constraint\EmptyConstraint;
use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Util\Filesystem;
use Composer\Script\ScriptEvents;
use Composer\Util\PackageSorter;
@ -580,7 +580,7 @@ EOF;
list($package, $installPath) = $item;
foreach (array_merge($package->getReplaces(), $package->getProvides()) as $link) {
if (preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) {
$extensionProviders[$match[1]][] = $link->getConstraint() ?: new EmptyConstraint();
$extensionProviders[$match[1]][] = $link->getConstraint() ?: new MatchAllConstraint();
}
}
}

View File

@ -16,7 +16,6 @@ use Composer\Package\AliasPackage;
use Composer\Package\Version\VersionParser;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Constraint\EmptyConstraint;
use Composer\Package\PackageInterface;
/**

View File

@ -22,7 +22,7 @@ use Composer\Repository\PlatformRepository;
use Composer\Repository\RootPackageRepository;
use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\EmptyConstraint;
use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Semver\Constraint\MultiConstraint;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Plugin\PrePoolCreateEvent;
@ -153,7 +153,7 @@ class PoolBuilder
}
$loadNames[$packageName] = $constraint;
$this->nameConstraints[$packageName] = $constraint && !($constraint instanceof EmptyConstraint) ? array($constraint) : null;
$this->nameConstraints[$packageName] = $constraint && !($constraint instanceof MatchAllConstraint) ? array($constraint) : null;
}
// clean up loadNames for anything we manually marked loaded above
@ -305,7 +305,7 @@ class PoolBuilder
}
$linkConstraint = $link->getConstraint();
if ($linkConstraint && !($linkConstraint instanceof EmptyConstraint)) {
if ($linkConstraint && !($linkConstraint instanceof MatchAllConstraint)) {
if (!\array_key_exists($require, $this->nameConstraints)) {
$this->nameConstraints[$require] = array($linkConstraint);
} elseif (\is_array($this->nameConstraints[$require])) {

View File

@ -31,7 +31,7 @@ use Composer\EventDispatcher\EventDispatcher;
use Composer\Downloader\TransportException;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Constraint\EmptyConstraint;
use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Util\Http\Response;
use Composer\Util\MetadataMinifier;
use Composer\Util\Url;
@ -265,7 +265,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
if (is_array($this->availablePackages)) {
$packageMap = array();
foreach ($this->availablePackages as $name) {
$packageMap[$name] = new EmptyConstraint();
$packageMap[$name] = new MatchAllConstraint();
}
$result = $this->loadAsyncPackages($packageMap);