PhpArrayFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 11 3
1
<?php
2
3
namespace T4web\Authentication\Adapter;
4
5
use Zend\ServiceManager\ServiceLocatorInterface;
6
use Zend\ServiceManager\FactoryInterface;
7
8
class PhpArrayFactory implements FactoryInterface
9
{
10
    /**
11
     * @param ServiceLocatorInterface $serviceLocator
12
     * @return PhpArray
13
     */
14
    public function createService(ServiceLocatorInterface $serviceLocator)
15
    {
16
        $config = $serviceLocator->get('Config');
17
18
        $authAccounts = [];
19
        if (isset($config['auth-accounts']) && is_array($config['auth-accounts'])) {
20
            $authAccounts = $config['auth-accounts'];
21
        }
22
23
        return new PhpArray($authAccounts);
24
    }
25
}
26