RedirectCallbackFactory.php 943 Bytes
Newer Older
1
2
3
4
<?php

namespace UnicaenAuth\Authentication;

5
use Interop\Container\ContainerInterface;
6
use Zend\Mvc\Application;
7
use Zend\Router\RouteInterface;
8
9
10
11
12
13
14
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcUser\Options\ModuleOptions;

class RedirectCallbackFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
15
16
17
18
    { return $this->__invoke($serviceLocator, '?');
    }

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
19
20
    {
        /* @var RouteInterface $router */
21
        $router = $container->get('Router');
22
23

        /* @var Application $application */
24
        $application = $container->get('Application');
25
26

        /* @var ModuleOptions $options */
27
        $options = $container->get('zfcuser_module_options');
28
29
30
31

        return new RedirectCallback($application, $router, $options);
    }
}