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.

ServiceContainer::getInstance()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 15
ccs 10
cts 10
cp 1
rs 9.4285
cc 2
eloc 9
nc 2
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the php-phantomjs.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
namespace JonnyW\PhantomJs\DependencyInjection;
10
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
12
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
13
use Symfony\Component\Config\FileLocator;
14
15
/**
16
 * PHP PhantomJs
17
 *
18
 * @author Jon Wenmoth <[email protected]>
19
 */
20
class ServiceContainer extends ContainerBuilder
21
{
22
    /**
23
     * Service container instance
24
     *
25
     * @var static
26
     * @access private
27
     */
28
    private static $instance;
29
30
    /**
31
     * Get singleton instance
32
     *
33
     * @access public
34
     * @return static
35
     */
36 43
    public static function getInstance()
37
    {
38 43
        if (null === self::$instance) {
39 1
            self::$instance = new static();
40
41 1
            $loader = new YamlFileLoader(self::$instance, new FileLocator(__DIR__.'/../Resources/config'));
42 1
            $loader->load('config.yml');
43 1
            $loader->load('services.yml');
44
45 1
            self::$instance->setParameter('phantomjs.cache_dir', sys_get_temp_dir());
46 1
            self::$instance->setParameter('phantomjs.resource_dir', __DIR__.'/../Resources');
47 1
        }
48
49 43
        return self::$instance;
50
    }
51
}
52