Failed Conditions
Push — master ( b8d841...bc596e )
by Florent
28:20
created

Configuration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 43
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getConfigTreeBuilder() 0 27 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\WebFingerBundle\DependencyInjection;
15
16
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
17
use Symfony\Component\Config\Definition\ConfigurationInterface;
18
19
class Configuration implements ConfigurationInterface
20
{
21
    /**
22
     * @var string
23
     */
24
    private $alias;
25
26
    /**
27
     * Configuration constructor.
28
     */
29
    public function __construct(string $alias)
30
    {
31
        $this->alias = $alias;
32
    }
33
34
    public function getConfigTreeBuilder()
35
    {
36
        $treeBuilder = new TreeBuilder();
37
        $rootNode = $treeBuilder->root($this->alias);
38
39
        $rootNode
40
            ->children()
41
            ->scalarNode('response_factory')
42
            ->info('The response factory service')
43
            ->isRequired()
44
            ->end()
45
            ->scalarNode('resource_repository')
46
            ->info('The resource repository service')
47
            ->isRequired()
48
            ->end()
49
            ->scalarNode('host')
50
            ->info('The host of the server (e.g. example.com, my-service.net)')
51
            ->isRequired()
52
            ->end()
53
            ->scalarNode('path')
54
            ->info('The path to the issuer discovery endpoint. Should be "/.well-known/webfinger" for compliance with the RFC7033.')
55
            ->defaultValue('/.well-known/webfinger')
56
            ->end()
57
            ->end();
58
59
        return $treeBuilder;
60
    }
61
}
62