BcryptFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 2 Features 1
Metric Value
c 3
b 2
f 1
dl 0
loc 17
wmc 1
lcom 0
cbo 3
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 7 1
1
<?php
2
/**
3
 * @author Stefano Torresi (http://stefanotorresi.it)
4
 * @license See the file LICENSE.txt for copying permission.
5
 * ************************************************
6
 */
7
8
namespace Thorr\OAuth2\Factory;
9
10
use Thorr\OAuth2\Options\ModuleOptions;
11
use Zend\Crypt\Password\Bcrypt;
12
use Zend\ServiceManager\FactoryInterface;
13
use Zend\ServiceManager\ServiceLocatorInterface;
14
15
class BcryptFactory implements FactoryInterface
16
{
17
    /**
18
     * Create service
19
     *
20
     * @param ServiceLocatorInterface $serviceLocator
21
     *
22
     * @return Bcrypt
23
     */
24
    public function createService(ServiceLocatorInterface $serviceLocator)
25
    {
26
        /** @var ModuleOptions $moduleOptions */
27
        $moduleOptions = $serviceLocator->get(ModuleOptions::class);
28
29
        return new Bcrypt(['cost' => $moduleOptions->getBcryptCost()]);
30
    }
31
}
32