TokenDefinition   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 54
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getPcre() 0 4 1
A isKeep() 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\Lexer\Definition;
11
12
/**
13
 * Class TokenDefinition
14
 */
15
class TokenDefinition
16
{
17
    /**
18
     * @var string
19
     */
20
    private $name;
21
22
    /**
23
     * @var string
24
     */
25
    private $pcre;
26
27
    /**
28
     * @var bool
29
     */
30
    private $keep;
31
32
    /**
33
     * TokenDefinition constructor.
34
     * @param string $name
35
     * @param string $pcre
36
     * @param bool $keep
37
     */
38
    public function __construct(string $name, string $pcre, bool $keep = true)
39
    {
40
        $this->name = $name;
41
        $this->pcre = $pcre;
42
        $this->keep = $keep;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getName(): string
49
    {
50
        return $this->name;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getPcre(): string
57
    {
58
        return $this->pcre;
59
    }
60
61
    /**
62
     * @return bool
63
     */
64
    public function isKeep(): bool
65
    {
66
        return $this->keep;
67
    }
68
}
69