Passed
Push — master ( a89473...8b9f9e )
by Edward
14:25
created

MatchRepeat::hasLexeme()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\Lexer\Runtime\Token;
6
7
use Remorhaz\Lexer\Runtime\IO\LexemeInterface;
8
9
/**
10
 * @psalm-immutable
11
 */
12
final class MatchRepeat implements MatchResultInterface
13
{
14
15
    /**
16
     * @return bool
17
     * @psalm-pure
18
     */
19
    public function shouldRepeat(): bool
20
    {
21
        return true;
22
    }
23
24
    /**
25
     * @return bool
26
     * @psalm-pure
27
     */
28
    public function hasToken(): bool
29
    {
30
        return false;
31
    }
32
33
    /**
34
     * @return TokenInterface
35
     * @psalm-pure
36
     */
37
    public function getToken(): TokenInterface
38
    {
39
        throw new Exception\TokenNotReadyException();
40
    }
41
42
    /**
43
     * @return bool
44
     * @psalm-pure
45
     */
46
    public function hasLexeme(): bool
47
    {
48
        return false;
49
    }
50
51
    /**
52
     * @return LexemeInterface
53
     * @psalm-pure
54
     */
55
    public function getLexeme(): LexemeInterface
56
    {
57
        throw new Exception\TokenNotReadyException();
58
    }
59
}
60