1
0
Fork 0

Remove redundancy in package type

pull/10210/head
Jordi Boggiano 2021-10-25 11:06:41 +02:00
parent 13d433fad0
commit 0e96f363e1
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 4 deletions

View File

@ -30,11 +30,11 @@ use Composer\Semver\Constraint\Constraint;
*/ */
class ArrayRepository implements RepositoryInterface class ArrayRepository implements RepositoryInterface
{ {
/** @var ?array<PackageInterface&BasePackage> */ /** @var ?array<BasePackage> */
protected $packages = null; protected $packages = null;
/** /**
* @var ?array<PackageInterface&BasePackage> indexed by package unique name and used to cache hasPackage calls * @var ?array<BasePackage> indexed by package unique name and used to cache hasPackage calls
*/ */
protected $packageMap = null; protected $packageMap = null;
@ -240,13 +240,12 @@ class ArrayRepository implements RepositoryInterface
} }
/** /**
* @phpstan-param PackageInterface&BasePackage $package
* @param string $alias * @param string $alias
* @param string $prettyAlias * @param string $prettyAlias
* *
* @return AliasPackage|CompleteAliasPackage * @return AliasPackage|CompleteAliasPackage
*/ */
protected function createAliasPackage(PackageInterface $package, $alias, $prettyAlias) protected function createAliasPackage(BasePackage $package, $alias, $prettyAlias)
{ {
while ($package instanceof AliasPackage) { while ($package instanceof AliasPackage) {
$package = $package->getAliasOf(); $package = $package->getAliasOf();