Passed
Push — master ( d38468...eb5cf9 )
by Al3x
01:39
created

RequestServiceFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace InvoiceNinjaModule\Service;
5
6
use Interop\Container\ContainerInterface;
7
use InvoiceNinjaModule\Options\ModuleOptions;
8
use InvoiceNinjaModule\Service\Interfaces\RequestServiceInterface;
9
use Laminas\Http\Client;
10
use Laminas\ServiceManager\Factory\FactoryInterface;
11
12
/**
13
 * Class RequestServiceFactory
14
 */
15
class RequestServiceFactory implements FactoryInterface
16
{
17
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null) : RequestServiceInterface
18
    {
19
        $settingsObj = $container->get(ModuleOptions::class);
20
        return new RequestService($settingsObj, new Client());
21
    }
22
}
23