GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Container::loadFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
/**
3
 * Container.php
4
 *
5
 * @package         Obfuscator
6
 * @subpackage      Container
7
 */
8
9
namespace Naneau\Obfuscator;
10
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
12
13
use Symfony\Component\Config\FileLocator;
14
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
15
16
/**
17
 * Container
18
 *
19
 * DI container setup for obfuscator
20
 *
21
 * @category        Naneau
22
 * @package         Obfuscator
23
 * @subpackage      Container
24
 */
25
class Container
26
{
27
    /**
28
     * the container
29
     *
30
     * @var ContainerBuilder
31
     */
32
    private $container;
33
34
    /**
35
     * Constructor
36
     *
37
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
38
     **/
39
    public function __construct()
40
    {
41
        $this->setContainer(new ContainerBuilder());
42
43
        $this->loadFile(__DIR__ . '/Resources/services.yml');
44
    }
45
46
    /**
47
     * Load a yaml config file
48
     *
49
     * @param string $file
50
     * @return Container
51
     **/
52
    public function loadFile($file)
53
    {
54
        $loader = new YamlFileLoader(
55
            $this->getContainer(),
56
            new FileLocator(dirname($file))
57
        );
58
        $loader->load(basename($file));
59
60
        return $this;
61
    }
62
63
    /**
64
     * Get the container
65
     *
66
     * @return ContainerBuilder
67
     */
68
    public function getContainer()
69
    {
70
        return $this->container;
71
    }
72
73
    /**
74
     * Set the container
75
     *
76
     * @param ContainerBuilder $container
77
     * @return Container
78
     */
79
    public function setContainer(ContainerBuilder $container)
80
    {
81
        $this->container = $container;
82
83
        return $this;
84
    }
85
}
86