Zend\Mvc\Service\HttpMethodListenerFactory::__invoke PHP Method

__invoke() public method

public __invoke ( Interop\Container\ContainerInterface $container, $name, array $options = null ) : HttpMethodListener
$container Interop\Container\ContainerInterface
$options array
return Zend\Mvc\HttpMethodListener
    public function __invoke(ContainerInterface $container, $name, array $options = null)
    {
        $config = $container->get('config');
        if (!isset($config['http_methods_listener'])) {
            return new HttpMethodListener();
        }
        $listenerConfig = $config['http_methods_listener'];
        $enabled = array_key_exists('enabled', $listenerConfig) ? $listenerConfig['enabled'] : true;
        $allowedMethods = isset($listenerConfig['allowed_methods']) && is_array($listenerConfig['allowed_methods']) ? $listenerConfig['allowed_methods'] : null;
        return new HttpMethodListener($enabled, $allowedMethods);
    }
HttpMethodListenerFactory