Skip to content

Commit

Permalink
zendframework#6266 - Using ArrayUtils::merge() for merging construc…
Browse files Browse the repository at this point in the history
…tor parameters
  • Loading branch information
Ocramius committed May 20, 2014
1 parent 8652a92 commit f91cf8f
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions library/Zend/Mvc/Service/ServiceManagerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Zend\Stdlib\ArrayUtils;

class ServiceManagerConfig extends Config
{
Expand Down Expand Up @@ -119,16 +120,17 @@ public function __construct(array $configuration = array())
return $serviceLocator;
};

$configuration = array_replace_recursive(array(
'invokables' => $this->invokables,
'factories' => $this->factories,
'abstract_factories' => $this->abstractFactories,
'aliases' => $this->aliases,
'shared' => $this->shared,
'delegators' => $this->delegators,
'initializers' => $this->initializers,
), $configuration);

parent::__construct($configuration);
parent::__construct(ArrayUtils::merge(
array(
'invokables' => $this->invokables,
'factories' => $this->factories,
'abstract_factories' => $this->abstractFactories,
'aliases' => $this->aliases,
'shared' => $this->shared,
'delegators' => $this->delegators,
'initializers' => $this->initializers,
),
$configuration
));
}
}

0 comments on commit f91cf8f

Please sign in to comment.