Failed Conditions
Push — ng ( 625bbc...a06888 )
by Florent
08:03
created

ClientRuleSource::name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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 2
nc 1
nop 0
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\ClientRule;
15
16
use OAuth2Framework\Bundle\Component\Component;
17
use OAuth2Framework\Component\ClientRule\Rule;
18
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
19
use Symfony\Component\Config\FileLocator;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
22
23
class ClientRuleSource implements Component
24
{
25
    /**
26
     * @return string
27
     */
28
    public function name(): string
29
    {
30
        return 'client_rule';
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function load(array $configs, ContainerBuilder $container)
37
    {
38
        $container->registerForAutoconfiguration(Rule::class)->addTag('oauth2_server_client_rule');
39
        $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config/client_rule'));
40
        $loader->load('client_rule.php');
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getNodeDefinition(NodeDefinition $node)
47
    {
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function prepend(ContainerBuilder $container, array $config): array
54
    {
55
        return [];
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function build(ContainerBuilder $container)
62
    {
63
        $container->addCompilerPass(new ClientRuleCompilerPass());
64
    }
65
}
66