Completed
Push — master ( e5166b...56b74c )
by Ilias
02:47
created

LexerToken   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 42
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getToken() 0 4 1
A getValue() 0 4 1
A isToken() 0 4 1
1
<?php
2
3
4
namespace CondParse;
5
6
7
class LexerToken
8
{
9
    /** @var string */
10
    private $token;
11
    /** @var mixed */
12
    private $value;
13
14
    /**
15
     * @param string $token
16
     * @param mixed $value
17
     */
18 42
    public function __construct($token, $value)
19
    {
20 42
        $this->token = $token;
21 42
        $this->value = $value;
22 42
    }
23
24
    /**
25
     * @return string
26
     */
27 24
    public function getToken()
28
    {
29 24
        return $this->token;
30
    }
31
32
    /**
33
     * @return mixed
34
     */
35 24
    public function getValue()
36
    {
37 24
        return $this->value;
38
    }
39
40
    /**
41
     * @param string $token
42
     * @return bool
43
     */
44 17
    public function isToken($token)
45
    {
46 17
        return $this->token === $token;
47
    }
48
}
49