Completed
Push — master ( 69b695...671bd7 )
by Kirill
06:49
created

Analyzer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 40
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A add() 0 4 1
A getResult() 0 4 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\Compiler\Grammar\PP2;
11
use Railt\Parser\Rule\Production;
12
use Railt\Parser\Rule\Symbol;
13
use Railt\Parser\Rule\Terminal;
14
15
/**
16
 * Class Analyzer
17
 */
18
class Analyzer
19
{
20
    /**
21
     * A list of parsed rules
22
     *
23
     * @var array|Symbol[]|Terminal[]|Production[]
24
     */
25
    private $parsed;
26
27
    /**
28
     * A list of kept rule names.
29
     *
30
     * @var array
31
     */
32
    private $keep;
33
34
    /**
35
     * Analyzer constructor.
36
     * @param array $parsed
37
     * @param array $keep
38
     */
39
    public function __construct(array $parsed, array $keep)
40
    {
41
        $this->parsed = $parsed;
42
        $this->keep = $keep;
43
    }
44
45
    public function add(string $rule, iterable $tokens)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $tokens is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
46
    {
47
        //
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function getResult(): array
54
    {
55
        return $this->parsed;
56
    }
57
}
58