Completed
Pull Request — 1.x (#627)
by Dylan
08:40
created

Db   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 11 1
1
<?php
2
3
namespace ZfcUser\Factory\Authentication\Adapter;
4
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use ZfcUser\Authentication\Adapter\Db as DbAdapter;
8
use ZfcUser\Mapper\UserInterface;
9
use ZfcUser\Options\AuthenticationOptionsInterface;
10
use ZfcUser\Options\ModuleOptions;
11
12
class Db implements FactoryInterface
13
{
14
    /**
15
     * Create service
16
     *
17
     * @param ServiceLocatorInterface $serviceLocator
18
     * @return mixed
19
     */
20
    public function createService(ServiceLocatorInterface $serviceLocator)
21
    {
22
        /** @var UserInterface $mapper */
23
        $mapper = $serviceLocator->get('zfcuser_user_mapper');
24
        /** @var AuthenticationOptionsInterface $options */
25
        $options = $serviceLocator->get('zfcuser_module_options');
26
        return new DbAdapter(
27
            $mapper,
28
            $options
29
        );
30
    }
31
}
32