JKUFactoryFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
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 TMV\JWTModule\DIFactory\KeyManagement;
6
7
use Jose\Component\KeyManagement\JKUFactory;
8
use Psr\Container\ContainerInterface;
9
use Psr\Http\Client\ClientInterface;
10
use Psr\Http\Message\RequestFactoryInterface;
11
12
class JKUFactoryFactory
13
{
14 3
    public function __invoke(ContainerInterface $container): JKUFactory
15
    {
16 3
        $clientName = $container->get('config')['jwt_module']['jku_factory']['http_client'] ?? ClientInterface::class;
17
18 3
        return new JKUFactory(
19 3
            $container->get($clientName),
20 3
            $container->get(RequestFactoryInterface::class)
21
        );
22
    }
23
}
24