Token   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getType() 0 4 1
A getValue() 0 4 1
A __toString() 0 4 1
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