AuthenticationServiceFactory.php 868 Bytes
Newer Older
1
2
3
4
<?php

namespace UnicaenAuth\Authentication;

5
6
use Interop\Container\ContainerInterface;
use Zend\Authentication\AuthenticationService;
7
8
9
10
11
12
13
14
15
16
17
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
 * Description of AuthenticationServiceFactory
 *
 * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
 */
class AuthenticationServiceFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
18
19
20
21
22
    {
        return $this->__invoke($serviceLocator, '?');
    }

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
23
24
    {
        return new AuthenticationService(
25
26
            $container->get('UnicaenAuth\Authentication\Storage\Chain'),
            $container->get('ZfcUser\Authentication\Adapter\AdapterChain')
27
28
29
        );
    }
}