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

ApplicationExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 1
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