Completed
Push — master ( a1f222...7ceccc )
by Emmanuel
03:50
created

ContainerFactory::createContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Edyan\Neuralyzer;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
9
10
class ContainerFactory
11
{
12
    public static function createContainer()
13
    {
14
        $container = new ContainerBuilder();
15
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../config'));
16
        $loader->load('services.yml');
17
        $container->addCompilerPass(new AddConsoleCommandPass());
18
        $container->compile();
19
20
        return $container;
21
    }
22
}
23