Failed Conditions
Pull Request — master (#33)
by Florent
06:23
created

DownloadedJWKSet::addConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 1
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\Config\Definition\Builder\NodeDefinition;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Definition;
17
use Symfony\Component\DependencyInjection\Reference;
18
19
abstract class DownloadedJWKSet extends AbstractJWKSetSource
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function addConfiguration(NodeDefinition $node)
25
    {
26
        parent::addConfiguration($node);
27
        $node
28
            ->children()
29
                ->scalarNode('url')->isRequired()->end()
30
                ->booleanNode('is_secured')->defaultTrue()->end()
31
                ->booleanNode('is_https')->defaultTrue()->end()
32
                ->scalarNode('cache')->defaultNull()->end()
33
                ->integerNode('cache_ttl')->defaultValue(86400)->end()
34
            ->end();
35
    }
36
}
37