Failed Conditions
Push — ng ( c00098...4b490a )
by Florent
06:57
created

AuthorizationEndpointResponseModeSource   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A continueLoading() 0 9 2
A name() 0 4 1
A getNodeDefinition() 0 9 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;
15
16
use Fluent\PhpConfigFileLoader;
17
use OAuth2Framework\Bundle\Component\Component;
18
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
19
use Symfony\Component\Config\FileLocator;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
22
class AuthorizationEndpointResponseModeSource implements Component
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: build, load, prepend
Loading history...
23
{
24
    /**
25
     * AuthorizationEndpointSource constructor.
26
     */
27
    public function __construct()
28
    {
29
        $this->addSubSource(new AuthorizationEndpointFormPostResponseModeSource());
0 ignored issues
show
Bug introduced by
The method addSubSource() does not seem to exist on object<OAuth2Framework\B...ointResponseModeSource>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected function continueLoading(string $path, ContainerBuilder $container, array $config)
36
    {
37
        foreach ($config as $k => $v) {
38
            $container->setParameter($path.'.'.$k, $v);
39
        }
40
41
        $loader = new PhpConfigFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config/endpoint'));
42
        $loader->load('response_mode.php');
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function name(): string
49
    {
50
        return 'response_mode';
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function getNodeDefinition(NodeDefinition $node)
57
    {
58
        $node
59
            ->children()
60
                ->booleanNode('allow_response_mode_parameter')
61
                    ->defaultFalse()
62
                ->end()
63
            ->end();
64
    }
65
}
66