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

ModuleOptionsFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
ccs 4
cts 4
cp 1
cc 1
eloc 4
nc 1
nop 3
crap 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 ModuleOptionsFactory
12
 */
13
class ModuleOptionsFactory 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
        return new ModuleOptions($settingsArr, $container->get(AuthOptions::class));
20
    }
21
}
22