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::load()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 13
nc 2
nop 2
dl 0
loc 19
rs 9.8333
c 0
b 0
f 0
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