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

Text::toString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

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