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

UrlChecker::mapConfig()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 4
nc 3
nop 3
dl 0
loc 8
rs 9.2
c 0
b 0
f 0
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