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

getNodeDefinition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
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;
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 AuthorizationEndpointFormPostResponseModeSource 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
     * {@inheritdoc}
26
     */
27
    protected function continueLoading(string $path, ContainerBuilder $container, array $config)
28
    {
29
        foreach ($config as $k => $v) {
30
            $container->setParameter($path.'.'.$k, $v);
31
        }
32
33
        $loader = new PhpConfigFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config/endpoint'));
34
        $loader->load('form_post_response_mode.php');
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function name(): string
41
    {
42
        return 'form_post';
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function getNodeDefinition(NodeDefinition $node)
49
    {
50
        $node
51
            ->children()
52
                ->scalarNode('template')
53
                    ->info('The template used to render the form.')
54
                    ->defaultValue('@OAuth2FrameworkBundle/form_post/response.html.twig')
55
                ->end()
56
            ->end();
57
    }
58
}
59