Completed
Push — master ( ad7fd3...b10ab8 )
by Théo
03:40
created

DefaultExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 1
1
<?php
2
3
/*
4
 * This file is part of the LaravelYaml package.
5
 *
6
 * (c) Théo FIDRY <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Fidry\LaravelYaml\DependencyInjection\Extension;
13
14
use Fidry\LaravelYaml\DependencyInjection\Builder\ContainerBuilder;
15
use Fidry\LaravelYaml\FileLoader\Yaml\YamlFileLoader;
16
use Illuminate\Support\Facades\App;
17
use Symfony\Component\Config\FileLocator;
18
19
/**
20
 * @author Théo FIDRY <[email protected]>
21
 */
22
final class DefaultExtension implements ExtensionInterface
23
{
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function load(ContainerBuilder $container)
29
    {
30
        $rootDir = new FileLocator(resource_path('/providers'));
31
        $loader = new YamlFileLoader($container, $rootDir);
32
        $loader
33
            ->load('parameters.yml')
34
            ->load(sprintf('parameters_%s.yml', App::environment()))
35
            ->load('services.yml')
36
        ;
37
    }
38
}
39