Completed
Push — master ( 88ff28...2dc58f )
by Kirill
06:03
created

TokenBuilder::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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\Reader\Resolver\Builder;
11
use Railt\Parser\Rule\Symbol;
12
use Railt\Parser\Rule\Token;
13
14
/**
15
 * Class TokenBuilder
16
 */
17
class TokenBuilder extends Builder
18
{
19
    /**
20
     * @var bool
21
     */
22
    private $keep;
23
24
    /**
25
     * TokenBuilder constructor.
26
     * @param int $id
27
     * @param string $name
28
     * @param bool $keep
29
     */
30
    public function __construct(int $id, string $name, bool $keep)
31
    {
32
        parent::__construct($id, $name);
33
        $this->keep = $keep;
34
    }
35
36
    /**
37
     * @return Symbol
38
     */
39
    public function build(): Symbol
40
    {
41
        return new Token($this->getId(), $this->getName(), $this->keep);
42
    }
43
}
44