1
0
Fork 0

Minor refactoring of RootPackageRepo

pull/8669/head
Jordi Boggiano 2020-02-13 16:29:57 +01:00
parent 71a98d8a7e
commit f35cd8948a
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
3 changed files with 10 additions and 3 deletions

View File

@ -54,7 +54,7 @@ EOT
$composer = $this->getComposer();
$installedRepos = array(
new RootPackageRepository(array(clone $composer->getPackage())),
new RootPackageRepository(clone $composer->getPackage()),
);
$locker = $composer->getLocker();

View File

@ -260,7 +260,7 @@ class Installer
$installedRepos = array(
$this->locker->getLockedRepository($this->devMode),
$this->createPlatformRepo(false),
new RootPackageRepository(array(clone $this->package)),
new RootPackageRepository(clone $this->package),
);
$this->suggestedPackagesReporter->outputMinimalistic(new CompositeRepository($installedRepos));
}
@ -706,7 +706,7 @@ class Installer
$this->fixedRootPackage->setDevRequires(array());
$repositorySet = new RepositorySet($minimumStability, $stabilityFlags, $rootAliases, $this->package->getReferences(), $rootRequires);
$repositorySet->addRepository(new RootPackageRepository(array($this->fixedRootPackage)));
$repositorySet->addRepository(new RootPackageRepository($this->fixedRootPackage));
$repositorySet->addRepository($platformRepo);
if ($this->additionalFixedRepository) {
$repositorySet->addRepository($this->additionalFixedRepository);

View File

@ -12,6 +12,8 @@
namespace Composer\Repository;
use Composer\Package\RootPackageInterface;
/**
* Root package repository.
*
@ -21,6 +23,11 @@ namespace Composer\Repository;
*/
class RootPackageRepository extends ArrayRepository
{
public function __construct(RootPackageInterface $package)
{
parent::__construct(array($package));
}
public function getRepoName()
{
return 'root package repo';