Failed Conditions
Push — ng ( 8fdb29...f5f23c )
by Florent
07:02
created

RequestObjectReferenceSource   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 51
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 4 1
A load() 0 3 1
A getNodeDefinition() 0 14 1
A prepend() 0 4 1
A build() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2018 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 OAuth2Framework\Bundle\Component\Endpoint\Authorization;
15
16
use OAuth2Framework\Bundle\Component\Component;
17
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
20
class RequestObjectReferenceSource implements Component
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function name(): string
26
    {
27
        return 'reference';
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function load(array $configs, ContainerBuilder $container)
34
    {
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getNodeDefinition(ArrayNodeDefinition $node, ArrayNodeDefinition $rootNode)
41
    {
42
        $node->children()
43
            ->arrayNode($this->name())
44
                ->canBeEnabled()
45
                ->children()
46
                    ->booleanNode('uris_registration_required')
47
                        ->info('If true, request object reference Uris must be registered to be used (highly recommended).')
48
                        ->defaultTrue()
49
                    ->end()
50
                ->end()
51
            ->end()
52
        ->end();
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function prepend(ContainerBuilder $container, array $config): array
59
    {
60
        return [];
61
    }
62
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function build(ContainerBuilder $container)
67
    {
68
        // Nothing to do
69
    }
70
}
71