Passed
Push — master ( 38d4f3...30ab2e )
by Adrien
14:46
created

SignedQueryMiddlewareFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 3
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ecodev\Felix\Middleware;
6
7
use Laminas\ServiceManager\Factory\FactoryInterface;
8
use Psr\Container\ContainerInterface;
9
10
class SignedQueryMiddlewareFactory implements FactoryInterface
11
{
12
    /**
13
     * @param string $requestedName
14
     */
15
    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): SignedQueryMiddleware
16
    {
17
        /** @var array $config */
18
        $config = $container->get('config');
19
        $signedQueries = $config['signedQueries'];
20
21
        return new SignedQueryMiddleware($signedQueries['keys'], $signedQueries['required']);
22
    }
23
}
24