Completed
Push — master ( 0b908e...886262 )
by Kevin
02:30
created

AbstractValuedToken   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 33
ccs 6
cts 9
cp 0.6667
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
use Groundskeeper\Configuration;
6
7
abstract class AbstractValuedToken extends AbstractToken
8
{
9
    /** @var string */
10
    private $value;
11
12
    /**
13
     * Constructor
14
     */
15 20
    public function __construct($type, Configuration $configuration, Token $parent = null, $value = null)
16
    {
17 20
        parent::__construct($type, $configuration, $parent);
18
19 20
        $this->value = $value;
20 20
    }
21
22
    /**
23
     * Getter for 'value'.
24
     */
25 16
    public function getValue()
26
    {
27 16
        return $this->value;
28
    }
29
30
    /**
31
     * Chainable setter for 'value'.
32
     */
33
    public function setValue($value)
34
    {
35
        $this->value = $value;
36
37
        return $this;
38
    }
39
}
40