Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into hotfix/translator-caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/AbstractPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ abstract class AbstractPluginManager extends ServiceManager implements ServiceLo
protected $autoAddInvokableClass = true;

/**
* @var mixed Options to use when creating an instance
* Options to use when creating an instance
*
* @var mixed
*/
protected $creationOptions = null;

Expand Down
5 changes: 3 additions & 2 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ public function getShared()

public function configureServiceManager(ServiceManager $serviceManager)
{
$allowOverride = $this->getAllowOverride();
isset($allowOverride) ? $serviceManager->setAllowOverride($allowOverride) : null;
if (($allowOverride = $this->getAllowOverride()) !== null) {
$serviceManager->setAllowOverride($allowOverride);
}

foreach ($this->getFactories() as $name => $factory) {
$serviceManager->setFactory($name, $factory);
Expand Down
2 changes: 1 addition & 1 deletion src/Di/DiServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function createService(ServiceLocatorInterface $serviceLocator)
* @param string $name
* @param array $params
* @return object
* @throws Exception\InvalidServiceNameException
* @throws Exception\ServiceNotFoundException
*/
public function get($name, array $params = array())
{
Expand Down
3 changes: 2 additions & 1 deletion src/Di/DiServiceInitializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Zend\ServiceManager\Di;

use Zend\Di\Di;
use Zend\Di\Exception\ClassNotFoundException as DiClassNotFoundException;
use Zend\ServiceManager\Exception;
use Zend\ServiceManager\InitializerInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
Expand Down Expand Up @@ -47,6 +46,8 @@ public function __construct(Di $di, ServiceLocatorInterface $serviceLocator, DiI

/**
* @param $instance
* @param ServiceLocatorInterface $serviceLocator
* @throws \Exception
*/
public function initialize($instance, ServiceLocatorInterface $serviceLocator)
{
Expand Down
18 changes: 12 additions & 6 deletions src/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Zend\ServiceManager;

use Closure;
use ReflectionClass;

class ServiceManager implements ServiceLocatorInterface
Expand Down Expand Up @@ -40,7 +41,7 @@ class ServiceManager implements ServiceLocatorInterface
protected $invokableClasses = array();

/**
* @var string|callable|Closure|InstanceFactoryInterface[]
* @var string|callable|Closure|FactoryInterface[]
*/
protected $factories = array();

Expand Down Expand Up @@ -231,8 +232,9 @@ public function setInvokableClass($name, $invokableClass, $shared = true)
/**
* @param string $name
* @param string|FactoryInterface|callable $factory
* @param bool $shared
* @param bool $shared
* @return ServiceManager
* @throws Exception\InvalidArgumentException
* @throws Exception\InvalidServiceNameException
*/
public function setFactory($name, $factory, $shared = true)
Expand Down Expand Up @@ -299,6 +301,7 @@ public function addAbstractFactory($factory, $topOfStack = true)

/**
* @param callable|InitializerInterface $initializer
* @param bool $topOfStack
* @return ServiceManager
* @throws Exception\InvalidArgumentException
*/
Expand Down Expand Up @@ -375,8 +378,9 @@ public function setShared($name, $isShared)
/**
* Retrieve a registered instance
*
* @param string $cName
* @param string $name
* @param bool $usePeeringServiceManagers
* @throws Exception\ServiceNotFoundException
* @return object|array
*/
public function get($name, $usePeeringServiceManagers = true)
Expand Down Expand Up @@ -436,8 +440,8 @@ public function get($name, $usePeeringServiceManagers = true)
/**
* @param string|array $name
* @return false|object
* @throws Exception\ServiceNotFoundException
* @throws Exception\ServiceNotCreatedException
* @throws Exception\InvalidServiceNameException
*/
public function create($name)
{
Expand Down Expand Up @@ -488,6 +492,7 @@ public function create($name)
* Determine if we can create an instance.
*
* @param string|array $name
* @param bool $checkAbstractFactories
* @return bool
*/
public function canCreate($name, $checkAbstractFactories = true)
Expand Down Expand Up @@ -666,6 +671,7 @@ protected function canonicalizeName($name)
* @param string $cName
* @param string $rName
* @throws Exception\ServiceNotCreatedException
* @throws Exception\ServiceNotFoundException
* @throws Exception\CircularDependencyFoundException
* @return object
*/
Expand Down Expand Up @@ -730,7 +736,7 @@ public function getCanonicalNames()
* Allows to override the canonical names lookup map with predefined
* values.
*
* @return array $canonicalNames
* @param array $canonicalNames
* @return ServiceManager
*/
public function setCanonicalNames($canonicalNames)
Expand Down Expand Up @@ -762,7 +768,7 @@ protected function retrieveFromPeeringManager($name)
* @param string $canonicalName
* @param string $requestedName
* @return null|\stdClass
* @throws Exception\ServiceNotCreatedException If resolved class does not exist
* @throws Exception\ServiceNotFoundException If resolved class does not exist
*/
protected function createFromInvokable($canonicalName, $requestedName)
{
Expand Down

0 comments on commit 2a78ec6

Please sign in to comment.