mirror of
https://github.com/composer/composer
synced 2025-05-11 01:22:54 +00:00
addPackage needs to trigger initialization too
This commit is contained in:
parent
575e520931
commit
05d527446b
1 changed files with 3 additions and 0 deletions
|
@ -30,6 +30,9 @@ class ArrayRepository implements RepositoryInterface
|
||||||
*/
|
*/
|
||||||
public function addPackage(PackageInterface $package)
|
public function addPackage(PackageInterface $package)
|
||||||
{
|
{
|
||||||
|
if (null === $this->packages) {
|
||||||
|
$this->initialize();
|
||||||
|
}
|
||||||
$package->setRepository($this);
|
$package->setRepository($this);
|
||||||
$this->packages[] = $package;
|
$this->packages[] = $package;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue