UserHydratorFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
namespace ZfcUser\Factory\Mapper;
3
4
use Zend\Crypt\Password\Bcrypt;
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use ZfcUser\Mapper;
8
9
class UserHydratorFactory implements FactoryInterface
10
{
11
    /**
12
     * {@inheritDoc}
13
     */
14
    public function createService(ServiceLocatorInterface $serviceLocator)
15
    {
16
        $options = $serviceLocator->get('zfcuser_module_options');
17
        $crypto  = new Bcrypt;
18
        $crypto->setCost($options->getPasswordCost());
19
        return new Mapper\UserHydrator($crypto);
20
    }
21
}
22