1
0
Fork 0

createPackage() method should use the $class argument it accepts

pull/4799/head
Stephen Beemsterboer 2016-01-20 01:34:37 -05:00
parent 546730dcf3
commit f1cf5d64dd
1 changed files with 3 additions and 3 deletions

View File

@ -370,7 +370,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
} }
// load acceptable packages in the providers // load acceptable packages in the providers
$package = $this->createPackage($version, 'Composer\Package\Package'); $package = $this->createPackage($version, 'Composer\Package\CompletePackage');
$package->setRepository($this); $package->setRepository($this);
if ($package instanceof AliasPackage) { if ($package instanceof AliasPackage) {
@ -606,14 +606,14 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
return $packages; return $packages;
} }
protected function createPackage(array $data, $class) protected function createPackage(array $data, $class = 'Composer\Package\CompletePackage')
{ {
try { try {
if (!isset($data['notification-url'])) { if (!isset($data['notification-url'])) {
$data['notification-url'] = $this->notifyUrl; $data['notification-url'] = $this->notifyUrl;
} }
$package = $this->loader->load($data, 'Composer\Package\CompletePackage'); $package = $this->loader->load($data, $class);
if (isset($this->sourceMirrors[$package->getSourceType()])) { if (isset($this->sourceMirrors[$package->getSourceType()])) {
$package->setSourceMirrors($this->sourceMirrors[$package->getSourceType()]); $package->setSourceMirrors($this->sourceMirrors[$package->getSourceType()]);
} }