Completed
Push — master ( 051826...bdcfe3 )
by Alessandro
06:32
created

TestContainer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContainer() 0 19 1
1
<?php
2
3
namespace Paraunit\Tests;
4
5
use Paraunit\Lifecycle\CompilerPass;
6
use Symfony\Component\Config\FileLocator;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
9
10
/**
11
 * Class TestContainer
12
 * @package Paraunit\Tests
13
 */
14
class TestContainer
15
{
16
    /**
17
     * @return ContainerBuilder
18
     */
19
    public static function getContainer()
20
    {
21
        $container = new ContainerBuilder();
22
23
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config/'));
24
        $loader->load('services.yml');
25
26
        $container->addCompilerPass(
27
            new CompilerPass(
28
                'event_dispatcher',
29
                'paraunit.event_listener',
30
                'paraunit.event_subscriber'
31
            )
32
        );
33
34
        $container->compile();
35
36
        return $container;
37
    }
38
}
39