AbstractSignatureSource   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 40
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getNodeDefinition() 0 32 1
A prepend() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2019 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\Signature;
15
16
use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source;
17
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
20
abstract class AbstractSignatureSource implements Source
21
{
22
    public function getNodeDefinition(NodeDefinition $node): void
23
    {
24
        $node
25
            ->children()
26
            ->arrayNode($this->name())
27
            ->useAttributeAsKey('name')
28
            ->arrayPrototype()
29
            ->children()
30
            ->booleanNode('is_public')
31
            ->info('If true, the service will be public, else private.')
32
            ->defaultTrue()
33
            ->end()
34
            ->arrayNode('signature_algorithms')
35
            ->info('A list of supported signature algorithms.')
36
            ->useAttributeAsKey('name')
37
            ->isRequired()
38
            ->requiresAtLeastOneElement()
39
            ->scalarPrototype()->end()
40
            ->end()
41
            ->arrayNode('tags')
42
            ->info('A list of tags to be associated to the service.')
43
            ->useAttributeAsKey('name')
44
            ->treatNullLike([])
45
            ->treatFalseLike([])
46
            ->variablePrototype()->end()
47
            ->end()
48
            ->end()
49
            ->end()
50
            ->end()
51
            ->end()
52
        ;
53
    }
54
55
    public function prepend(ContainerBuilder $container, array $config): array
56
    {
57
        return [];
58
    }
59
}
60