JKU   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getKeySet() 0 4 1
A createDefinition() 0 17 2
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2016 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace SpomkyLabs\JoseBundle\DependencyInjection\Source\JWKSetSource;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Definition;
16
use Symfony\Component\DependencyInjection\Reference;
17
18
final class JKU extends DownloadedJWKSet
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function createDefinition(ContainerBuilder $container, array $config)
24
    {
25
        $definition = new Definition('Jose\Object\JKUJWKSet');
26
        $definition->setFactory([
27
            new Reference('jose.factory.jwk'),
28
            'createFromJKU',
29
        ]);
30
        $definition->setArguments([
31
            $config['url'],
32
            $config['is_secured'],
33
            null !== $config['cache'] ? new Reference($config['cache']) : null,
34
            $config['cache_ttl'],
35
            $config['is_https'],
36
        ]);
37
38
        return $definition;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function getKeySet()
45
    {
46
        return 'jku';
47
    }
48
}
49