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::prepend()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 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