AuthenticatorServiceFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 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
}