Completed
Push — master ( b66e97...9d450b )
by Kevin
02:16
created

Text   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 85.71%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 3
c 2
b 0
f 2
lcom 1
cbo 1
dl 0
loc 19
ccs 6
cts 7
cp 0.8571
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toString() 0 8 2
1
<?php
2
3
namespace Groundskeeper\Tokens;
4
5
use Groundskeeper\Configuration;
6
7
class Text extends AbstractValuedToken
8
{
9
    /**
10
     * Constructor
11
     */
12 2
    public function __construct(Token $parent = null, $value = null)
13
    {
14 2
        parent::__construct(Token::TEXT, $parent, $value);
15 2
    }
16
17 2
    public function toString(Configuration $configuration, $prefix = '', $suffix = '')
18
    {
19 2
        if (!$this->isValid) {
20
            return '';
21
        }
22
23 2
        return $prefix . $this->getValue() . $suffix;
24
    }
25
}
26