Completed
Push — master ( 15a7c5...a9adfd )
by Kevin
02:15
created

AbstractValuedToken::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 3
crap 2
1
<?php
2
3
namespace Groundskeeper\Tokens;
4
5
abstract class AbstractValuedToken extends AbstractToken
6
{
7
    /** @var string */
8
    private $value;
9
10
    /**
11
     * Constructor
12
     */
13
    public function __construct($type, Token $parent = null, $value = null)
14
    {
15
        parent::__construct($type, $parent);
16
17
        $this->setValue($value);
18
    }
19
20
    /**
21
     * Getter for 'value'.
22
     */
23
    public function getValue()
24
    {
25
        return $this->value;
26
    }
27
28
    /**
29
     * Chainable setter for 'value'.
30
     */
31
    public function setValue($value)
32
    {
33
        $this->value = $value;
34
35
        return $this;
36
    }
37
}
38