Token::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace PeacefulBit\Slate\Parser\Tokens;
4
5
class Token
6
{
7
    /**
8
     * @var string
9
     */
10
    private $type;
11
12
    /**
13
     * @var mixed
14
     */
15
    private $value;
16
17
    /**
18
     * @param string $type
19
     * @param mixed $value
20
     */
21
    public function __construct(string $type, $value)
22
    {
23
        $this->type = $type;
24
        $this->value = $value;
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getType(): string
31
    {
32
        return $this->type;
33
    }
34
35
    /**
36
     * @return mixed
37
     */
38
    public function getValue()
39
    {
40
        return $this->value;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function __toString()
47
    {
48
        return $this->getType() . ':' . strval($this->getValue());
49
    }
50
}
51