AuthenticatorServiceFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 10 1
1
<?php
2
3
namespace Faulancer\Service\Factory;
4
5
use Faulancer\Controller\Controller;
6
use Faulancer\Service\AuthenticatorService;
7
use Faulancer\Service\Config;
8
use Faulancer\ServiceLocator\FactoryInterface;
9
use Faulancer\ServiceLocator\ServiceLocatorInterface;
10
11
/**
12
 * Class AuthenticatorServiceFactory
13
 *
14
 * @package Faulancer\Service\Factory
15
 * @author  Florian Knapp <[email protected]>
16
 */
17
class AuthenticatorServiceFactory implements FactoryInterface
18
{
19
20
    /**
21
     * @param ServiceLocatorInterface $serviceLocator
22
     *
23
     * @return AuthenticatorService
24
     */
25
    public function createService(ServiceLocatorInterface $serviceLocator)
26
    {
27
        /** @var Controller $controller */
28
        $controller = $serviceLocator->get(Controller::class);
29
30
        /** @var Config $config */
31
        $config = $serviceLocator->get(Config::class);
32
33
        return new AuthenticatorService($controller, $config);
34
    }
35
36
}