GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

WebfactoryShortcodeExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 19 2
1
<?php
2
3
namespace Webfactory\ShortcodeBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\ChildDefinition;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
11
/**
12
 * Loads the bundle configuration.
13
 */
14
final class WebfactoryShortcodeExtension extends Extension
15
{
16
    public function load(array $configs, ContainerBuilder $container)
17
    {
18
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
19
        $loader->load('shortcodes.xml');
20
        $loader->load('guide.xml');
21
22
        $configuration = new Configuration();
23
        $config = $this->processConfiguration($configuration, $configs);
24
25
        $container->setAlias('webfactory_shortcode.parser', 'webfactory_shortcode.'.$config['parser'].'_parser');
26
27
        $container->setParameter('webfactory_shortcode.recursion_depth', $config['recursion_depth']);
28
        $container->setParameter('webfactory_shortcode.max_iterations', $config['max_iterations']);
29
30
        foreach ($config['shortcodes'] as $shortcodeName => $shortcodeDefinition) {
31
            $definition = new ChildDefinition('Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.'.$shortcodeDefinition['method']);
32
            $definition->replaceArgument(1, $shortcodeDefinition['controller']);
33
            $definition->addTag('webfactory.shortcode', ['shortcode' => $shortcodeName, 'description' => $shortcodeDefinition['description'], 'example' => $shortcodeDefinition['example']]);
34
            $container->setDefinition('webfactory_shortcode.handler.'.$shortcodeName, $definition);
35
        }
36
    }
37
}
38