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.
Completed
Push — master ( 2a285b...6e1fa3 )
by Edi
08:38
created

NetgenEnhancedSelectionExtension   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
B load() 0 24 4
A prepend() 0 7 1
1
<?php
2
3
namespace Netgen\Bundle\EnhancedSelectionBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\Config\Resource\FileResource;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
9
use Symfony\Component\DependencyInjection\Loader;
10
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
11
use Symfony\Component\Yaml\Yaml;
12
13
class NetgenEnhancedSelectionExtension extends Extension implements PrependExtensionInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function load(array $configs, ContainerBuilder $container)
19
    {
20
        $loader = new Loader\YamlFileLoader(
21
            $container,
22
            new FileLocator(__DIR__ . '/../Resources/config')
23
        );
24
25
        $loader->load('field_types.yml');
26
        $loader->load('templating.yml');
27
28
        $activatedBundles = array_keys($container->getParameter('kernel.bundles'));
29
30
        if (in_array('EzPublishLegacySearchEngineBundle', $activatedBundles, true)) {
31
            $loader->load('search/legacy.yml');
32
        }
33
34
        if (in_array('EzSystemsEzPlatformSolrSearchEngineBundle', $activatedBundles, true)) {
35
            $loader->load('search/solr.yml');
36
        }
37
38
        if (in_array('EzPlatformAdminUiBundle', $activatedBundles, true)) {
39
            $loader->load('ezadminui/services.yml');
40
        }
41
    }
42
43
    /**
44
     * Allow an extension to prepend the extension configurations.
45
     *
46
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
47
     */
48
    public function prepend(ContainerBuilder $container)
49
    {
50
        $configFile = __DIR__ . '/../Resources/config/ezplatform.yml';
51
        $config = Yaml::parse(file_get_contents($configFile));
52
        $container->prependExtensionConfig('ezpublish', $config);
53
        $container->addResource(new FileResource($configFile));
54
    }
55
}
56