Token   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 41
c 0
b 0
f 0
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getType() 0 3 1
A getValue() 0 3 1
1
<?php
2
3
namespace Vlaswinkel\Lua;
4
5
/**
6
 * Class Token
7
 *
8
 * @author  Koen Vlaswinkel <[email protected]>
9
 * @package Vlaswinkel\Lua
10
 */
11
class Token {
12
    const TYPE_STRING = 1;
13
    const TYPE_NUMBER = 2;
14
    const TYPE_PUNCTUATION = 3;
15
    const TYPE_IDENTIFIER = 4;
16
    const TYPE_KEYWORD = 5;
17
18
    /**
19
     * @var int
20
     */
21
    private $type;
22
    /**
23
     * @var string
24
     */
25
    private $value;
26
27
    /**
28
     * Token constructor.
29
     *
30
     * @param int    $type
31
     * @param string $value
32
     */
33 36
    public function __construct($type, $value) {
34 36
        $this->type  = $type;
35 36
        $this->value = $value;
36 36
    }
37
38
    /**
39
     * @return int
40
     */
41 36
    public function getType() {
42 36
        return $this->type;
43
    }
44
45
    /**
46
     * @return string
47
     */
48 36
    public function getValue() {
49 36
        return $this->value;
50
    }
51
}