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

Text::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 1
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