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

Db::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace ZfcUser\Factory\Authentication\Storage;
4
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use ZfcUser\Authentication\Storage\Db as DbStorage;
8
use ZfcUser\Mapper\UserInterface;
9
10
class Db implements FactoryInterface
11
{
12
    /**
13
     * Create service
14
     *
15
     * @param ServiceLocatorInterface $serviceLocator
16
     * @return mixed
17
     */
18
    public function createService(ServiceLocatorInterface $serviceLocator)
19
    {
20
        /** @var UserInterface $mapper */
21
        $mapper = $serviceLocator->get('zfcuser_user_mapper');
22
        return new DbStorage(
23
            $mapper
24
        );
25
    }
26
}
27