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

RequestObjectReferenceSource::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

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 1
nc 1
nop 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