Completed
Push — master ( 5bac00...4dd860 )
by Nikola
02:03
created

Parser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 8 2
1
<?php
2
/*
3
 * This file is part of the Abstract builder package, an RunOpenCode project.
4
 *
5
 * (c) 2017 RunOpenCode
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace RunOpenCode\AbstractBuilder\Ast;
11
12
use PhpParser\Lexer\Emulative;
13
use PhpParser\Parser\Php7;
14
15
/**
16
 * Class Parser
17
 *
18
 * @package RunOpenCode\AbstractBuilder\Ast
19
 */
20
class Parser extends Php7
21
{
22
    /**
23
     * @var Parser
24
     */
25
    private static $instance;
26
27
    /**
28
     * Get shared parser instance. Singleton implementation.
29
     *
30
     * @return Parser|static
31
     */
32 1
    public static function getInstance()
33
    {
34 1
        if (null === self::$instance) {
35 1
            self::$instance = new Parser(new Emulative(), []);
36
        }
37
38 1
        return self::$instance;
39
    }
40
}
41