Completed
Pull Request — master (#16)
by Flo
07:29
created

AuthenticatorServiceFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
/**
3
 * Class AuthenticatorServiceFactory | AuthenticatorServiceFactory.php
4
 * @package Faulancer\Service\Factory
5
 * @author  Florian Knapp <[email protected]>
6
 */
7
namespace Faulancer\Service\Factory;
8
9
use Faulancer\Service\AuthenticatorService;
10
use Faulancer\Service\Config;
11
use Faulancer\Controller\Controller;
12
use Faulancer\Service\ControllerService;
13
use Faulancer\ServiceLocator\FactoryInterface;
14
use Faulancer\ServiceLocator\ServiceLocatorInterface;
15
16
/**
17
 * Class AuthenticatorServiceFactory
18
 */
19
class AuthenticatorServiceFactory implements FactoryInterface
20
{
21
22
    /**
23
     * @param ServiceLocatorInterface $serviceLocator
24
     * @return AuthenticatorService
25
     * @codeCoverageIgnore
26
     */
27
    public function createService(ServiceLocatorInterface $serviceLocator)
28
    {
29
        /** @var Controller $controller */
30
        $controller = $serviceLocator->get(ControllerService::class);
31
32
        /** @var Config $config */
33
        $config = $serviceLocator->get(Config::class);
34
35
        return new AuthenticatorService($controller, $config);
36
    }
37
38
}