Zend\Mvc\Controller\LazyControllerAbstractFactory::__invoke PHP Method

__invoke() public method

{@inheritDoc}
public __invoke ( Interop\Container\ContainerInterface $container, $requestedName, array $options = null ) : Zend\Stdlib\DispatchableInterface
$container Interop\Container\ContainerInterface
$options array
return Zend\Stdlib\DispatchableInterface
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $reflectionClass = new ReflectionClass($requestedName);
        if (null === ($constructor = $reflectionClass->getConstructor())) {
            return new $requestedName();
        }
        $reflectionParameters = $constructor->getParameters();
        if (empty($reflectionParameters)) {
            return new $requestedName();
        }
        $parameters = array_map($this->resolveParameter($container, $requestedName), $reflectionParameters);
        return new $requestedName(...$parameters);
    }
LazyControllerAbstractFactory