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

AbstractValuedToken   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

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 9
cts 9
cp 1
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 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