Completed
Push — master ( 7a3efc...f79493 )
by Al3x
02:58
created

AuthOptionsFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
namespace InvoiceNinjaModule\Options;
5
6
use Interop\Container\ContainerInterface;
7
use InvoiceNinjaModule\Module;
8
use Zend\ServiceManager\Factory\FactoryInterface;
9
10
/**
11
 * Class AuthOptionsFactory
12
 */
13
class AuthOptionsFactory implements FactoryInterface
14
{
15 2
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
16
    {
17 2
        $config = $container->get('Config');
18 2
        $settingsArr = $config[Module::INVOICE_NINJA_CONFIG] ?? [];
19 2
        $authArr = $settingsArr[Module::AUTHORIZATION] ?? [];
20 2
        return new AuthOptions($authArr);
21
    }
22
}
23