Completed
Push — master ( 1f3fa8...7d4b61 )
by Mike
03:08
created

ApplicationExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 2
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Sugarcrm\UpgradeSpec\DI\Extension;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\Config\Loader\LoaderResolver;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Extension\Extension;
9
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
10
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
11
12
class ApplicationExtension extends Extension
13
{
14
    /**
15
     * @param array $configs
16
     * @param ContainerBuilder $container
17
     */
18
    public function load(array $configs, ContainerBuilder $container)
19
    {
20
        $fileLocator = new FileLocator(APPLICATION_ROOT);
21
        $loader = new DirectoryLoader($container, $fileLocator);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
22
        $loader->setResolver(new LoaderResolver([
23
            new XmlFileLoader($container, $fileLocator),
24
            $loader,
25
        ]));
26
        $loader->load('./resources/services/');
27
    }
28
}
29