mirror of
https://github.com/composer/composer
synced 2025-05-11 01:22:54 +00:00
Move some code around
This commit is contained in:
parent
c81a776279
commit
f546025bae
1 changed files with 5 additions and 4 deletions
|
@ -34,6 +34,11 @@ class PackageRepository extends ArrayRepository
|
||||||
public function __construct(array $config)
|
public function __construct(array $config)
|
||||||
{
|
{
|
||||||
$this->config = $config['package'];
|
$this->config = $config['package'];
|
||||||
|
|
||||||
|
// make sure we have an array of package definitions
|
||||||
|
if (!is_numeric(key($this->config))) {
|
||||||
|
$this->config = array($this->config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,10 +48,6 @@ class PackageRepository extends ArrayRepository
|
||||||
{
|
{
|
||||||
parent::initialize();
|
parent::initialize();
|
||||||
|
|
||||||
if (!is_numeric(key($this->config))) {
|
|
||||||
$this->config = array($this->config);
|
|
||||||
}
|
|
||||||
|
|
||||||
$loader = new ArrayLoader();
|
$loader = new ArrayLoader();
|
||||||
foreach ($this->config as $package) {
|
foreach ($this->config as $package) {
|
||||||
$package = $loader->load($package);
|
$package = $loader->load($package);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue