JKUFactoryFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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