DefaultExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 4
Bugs 1 Features 3
Metric Value
c 4
b 1
f 3
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
crap 2
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