1
0
Fork 0

Make sure InstalledRepository itself can be added too but requires allowing installed repos in reposet

pull/8684/head
Jordi Boggiano 2020-03-11 17:02:25 +01:00
parent 589aa351a8
commit 9c84f4d79f
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository; use Composer\Repository\PlatformRepository;
use Composer\Repository\LockArrayRepository; use Composer\Repository\LockArrayRepository;
use Composer\Repository\InstalledRepositoryInterface; use Composer\Repository\InstalledRepositoryInterface;
use Composer\Repository\InstalledRepository;
use Composer\Semver\Constraint\ConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Package\Version\StabilityFilter; use Composer\Package\Version\StabilityFilter;
@ -190,7 +191,7 @@ class RepositorySet
$poolBuilder = new PoolBuilder($this->acceptableStabilities, $this->stabilityFlags, $this->rootAliases, $this->rootReferences, $eventDispatcher); $poolBuilder = new PoolBuilder($this->acceptableStabilities, $this->stabilityFlags, $this->rootAliases, $this->rootReferences, $eventDispatcher);
foreach ($this->repositories as $repo) { foreach ($this->repositories as $repo) {
if ($repo instanceof InstalledRepositoryInterface && !$this->allowInstalledRepositories) { if (($repo instanceof InstalledRepositoryInterface || $repo instanceof InstalledRepository) && !$this->allowInstalledRepositories) {
throw new \LogicException('The pool can not accept packages from an installed repository'); throw new \LogicException('The pool can not accept packages from an installed repository');
} }
} }