Completed
Push — master ( e81671...a22352 )
by André
93:06 queued 73:42
created

UrlChecker   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addSemanticConfig() 0 13 1
A mapConfig() 0 8 4
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser;
8
9
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\AbstractParser;
10
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
11
use Symfony\Component\Config\Definition\Builder\NodeBuilder;
12
13
class UrlChecker extends AbstractParser
14
{
15
    public function addSemanticConfig(NodeBuilder $nodeBuilder)
16
    {
17
        $nodeBuilder
0 ignored issues
show
Bug introduced by
The method useAttributeAsKey() does not seem to exist on object<Symfony\Component...on\Builder\NodeBuilder>.

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...
18
            ->arrayNode('url_checker')
19
                ->children()
20
                    ->arrayNode('handlers')
21
                        ->prototype('variable')
22
                        ->end()
23
                        ->useAttributeAsKey('name')
24
                    ->end()
25
                ->end()
26
            ->end();
27
    }
28
29
    public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
30
    {
31
        if (isset($scopeSettings['url_checker']) && !empty($scopeSettings['url_checker']['handlers'])) {
32
            foreach ($scopeSettings['url_checker']['handlers'] as $name => $options) {
33
                $contextualizer->setContextualParameter('url_handler.' . $name . '.options', $currentScope, $options);
34
            }
35
        }
36
    }
37
}
38