1
0
Fork 0

Merge pull request #4088 from nevvermind/override_init_array

Fix "Invalid argument supplied for foreach()" on a new PlaformRepository obj
pull/4103/head
Jordi Boggiano 2015-06-03 11:40:44 +01:00
commit cdcc99e73d
1 changed files with 2 additions and 3 deletions

View File

@ -32,15 +32,14 @@ class PlatformRepository extends ArrayRepository
* *
* @var array * @var array
*/ */
private $overrides; private $overrides = array();
public function __construct(array $packages = array(), array $overrides = array()) public function __construct(array $packages = array(), array $overrides = array())
{ {
parent::__construct($packages);
$this->overrides = array();
foreach ($overrides as $name => $version) { foreach ($overrides as $name => $version) {
$this->overrides[strtolower($name)] = array('name' => $name, 'version' => $version); $this->overrides[strtolower($name)] = array('name' => $name, 'version' => $version);
} }
parent::__construct($packages);
} }
protected function initialize() protected function initialize()