Completed
Push — master ( 450e0e...3bb600 )
by Kirill
05:06
created

MultistateTokenDefinition::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 5
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\Lexer\Definition;
11
12
/**
13
 * Class MultistateTokenDefinition
14
 */
15
class MultistateTokenDefinition extends TokenDefinition
16
{
17
    /**
18
     * @var int
19
     */
20
    private $state;
21
22
    /**
23
     * @var int
24
     */
25
    private $nextState;
26
27
    /**
28
     * MultistateTokenDefinition constructor.
29
     * @param string $name
30
     * @param string $pcre
31
     * @param bool $keep
32
     * @param int $state
33
     * @param int $nextState
34
     */
35
    public function __construct(string $name, string $pcre, bool $keep = true, int $state = 0, int $nextState = 0)
36
    {
37
        parent::__construct($name, $pcre, $keep);
38
        $this->state     = $state;
39
        $this->nextState = $nextState;
40
    }
41
42
    /**
43
     * @return int
44
     */
45
    public function getState(): int
46
    {
47
        return $this->state;
48
    }
49
50
    /**
51
     * @return int
52
     */
53
    public function getNextState(): int
54
    {
55
        return $this->nextState;
56
    }
57
}
58