Completed
Push — master ( fb6bbb...5c4144 )
by Théo
7s
created

DefaultExtension::loadResourceIfExist()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
ccs 0
cts 4
cp 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
crap 6
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 Illuminate\Support\Facades\App;
16
17
/**
18
 * @author Théo FIDRY <[email protected]>
19
 */
20
final class DefaultExtension extends AbstractExtension
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function load(ContainerBuilder $container)
26
    {
27
        $loader = parent::load($container);
28
29
        $this
30
            ->loadResourceIfExist($loader, 'parameters.yml')
31
            ->loadResourceIfExist($loader, 'services.yml')
32
            ->loadResourceIfExist($loader, sprintf('parameters_%s.yml', App::environment()))
33
        ;
34
    }
35
}
36