Passed
Push — master ( 0f10a6...8f1e95 )
by Koen
11:27
created

Token::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 4
cts 4
cp 1
rs 10
cc 1
eloc 3
nc 1
nop 2
crap 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 20
    public function __construct($type, $value) {
34 20
        $this->type  = $type;
35 20
        $this->value = $value;
36 20
    }
37
38
    /**
39
     * @return int
40
     */
41 20
    public function getType() {
42 20
        return $this->type;
43
    }
44
45
    /**
46
     * @return string
47
     */
48 20
    public function getValue() {
49 20
        return $this->value;
50
    }
51
}