AuthenticationServiceFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
namespace ZfcUser\Factory;
3
4
use Zend\Authentication\AuthenticationService;
5
use Zend\Authentication\Adapter;
6
use Zend\Authentication\Storage;
7
use Zend\ServiceManager\FactoryInterface;
8
use Zend\ServiceManager\ServiceLocatorInterface;
9
10
class AuthenticationServiceFactory implements FactoryInterface
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15
    public function createService(ServiceLocatorInterface $serviceLocator)
16
    {
17
        /* @var $authStorage Storage\StorageInterface */
18
        $authStorage = $serviceLocator->get('ZfcUser\Authentication\Storage\Db');
19
20
        /* @var $authAdapter Adapter\AdapterInterface */
21
        $authAdapter = $serviceLocator->get('ZfcUser\Authentication\Adapter\AdapterChain');
22
23
        return new AuthenticationService(
24
            $authStorage,
25
            $authAdapter
26
        );
27
    }
28
}
29