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

AbstractValuedToken   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 33
ccs 0
cts 14
cp 0
rs 10

3 Methods

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