JKU::getKeySet()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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