LmcUserAuthentication   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 11 1
A createService() 0 6 1
1
<?php
2
3
namespace LmcUser\Factory\Controller\Plugin;
4
5
use Interop\Container\ContainerInterface;
6
use Laminas\ServiceManager\Factory\FactoryInterface;
7
use Laminas\ServiceManager\ServiceLocatorInterface;
8
use LmcUser\Controller;
9
10
class LmcUserAuthentication implements FactoryInterface
11
{
12
    public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
13
    {
14
        $authService = $serviceLocator->get('lmcuser_auth_service');
15
        $authAdapter = $serviceLocator->get('LmcUser\Authentication\Adapter\AdapterChain');
16
17
        $controllerPlugin = new Controller\Plugin\LmcUserAuthentication;
18
        $controllerPlugin->setAuthService($authService);
19
        $controllerPlugin->setAuthAdapter($authAdapter);
20
21
        return $controllerPlugin;
22
    }
23
24
    /**
25
     * Create service
26
     *
27
     * @param  ServiceLocatorInterface $serviceManager
28
     * @return mixed
29
     */
30
    public function createService(ServiceLocatorInterface $serviceManager)
31
    {
32
        $serviceLocator = $serviceManager->getServiceLocator();
33
34
        return $this->__invoke($serviceLocator, null);
35
    }
36
}
37