DbFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
A createService() 0 4 1
1
<?php
2
3
namespace LmcUser\Factory\Authentication\Adapter;
4
5
use Interop\Container\ContainerInterface;
6
use Laminas\ServiceManager\Factory\FactoryInterface;
7
use Laminas\ServiceManager\ServiceLocatorInterface;
8
use LmcUser\Authentication\Adapter\Db;
9
10
class DbFactory implements FactoryInterface
11
{
12
    public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
13
    {
14
        $db = new Db();
15
        $db->setServiceManager($serviceLocator);
16
17
        return $db;
18
    }
19
20
    /**
21
     * Create service
22
     *
23
     * @param  ServiceLocatorInterface $serviceLocator
24
     * @return mixed
25
     */
26
    public function createService(ServiceLocatorInterface $serviceLocator)
27
    {
28
        return $this->__invoke($serviceLocator, null);
29
    }
30
}
31