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

SignedQueryMiddlewareFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

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