Completed
Push — master ( a9adfd...b66e97 )
by Kevin
02:14
created

AbstractValuedToken::setValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
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 8
    public function __construct($type, Token $parent = null, $value = null)
14
    {
15 8
        parent::__construct($type, $parent);
16
17 8
        $this->setValue($value);
18 8
    }
19
20
    /**
21
     * Getter for 'value'.
22
     */
23 8
    public function getValue()
24
    {
25 8
        return $this->value;
26
    }
27
28
    /**
29
     * Chainable setter for 'value'.
30
     */
31 8
    public function setValue($value)
32
    {
33 8
        $this->value = $value;
34
35 8
        return $this;
36
    }
37
}
38