Passed
Push — master ( c2faf8...afa411 )
by Al3x
11:51
created

AuthOptionsFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 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 Laminas\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