Test Failed
Push — master ( a0eed4...bb00ac )
by Kirill
149:40
created

DescriptionValueNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A toPrimitive() 0 4 1
A toValue() 0 4 1
A toString() 0 4 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Frontend\AST\Invocation;
11
12
use Railt\Io\Readable;
13
use Railt\Parser\Ast\Rule;
14
use Railt\SDL\IR\ValueInterface;
15
16
/**
17
 * Class DescriptionValue
18
 */
19
class DescriptionValueNode extends Rule implements AstValueInterface
20
{
21
    /**
22
     * @return string
23
     */
24
    public function toPrimitive(): string
25
    {
26
        return $this->toString()->toPrimitive();
27
    }
28
29
    /**
30
     * @param Readable $file
31
     * @return ValueInterface
32
     */
33
    public function toValue(Readable $file): ValueInterface
34
    {
35
        return $this->toString()->toValue($file);
36
    }
37
38
    /**
39
     * @return StringValueNode
40
     */
41
    private function toString(): StringValueNode
42
    {
43
        return $this->getChild(0);
44
    }
45
}
46