3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Mvc\Service
;
12 use Interop\Container\ContainerInterface
;
13 use Zend\Mvc\DispatchListener
;
14 use Zend\ServiceManager\FactoryInterface
;
15 use Zend\ServiceManager\ServiceLocatorInterface
;
17 class DispatchListenerFactory
implements FactoryInterface
20 * Create the default dispatch listener.
22 * @param ContainerInterface $container
24 * @param null|array $options
25 * @return DispatchListener
27 public function __invoke(ContainerInterface
$container, $name, array $options = null)
29 return new DispatchListener($container->get('ControllerManager'));
33 * Create and return DispatchListener instance
35 * For use with zend-servicemanager v2; proxies to __invoke().
37 * @param ServiceLocatorInterface $container
38 * @return DispatchListener
40 public function createService(ServiceLocatorInterface
$container)
42 return $this($container, DispatchListener
::class);