Completed
Push — master ( 9b99ba...c3f75f )
by Kirill
02:20
created

TextNode::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of Platform 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 Karma\Platform\Ast;
11
12
/**
13
 * Class TextNode
14
 * @package Karma\Platform\Ast
15
 */
16
class TextNode implements NodeInterface
17
{
18
    /**
19
     * @var string
20
     */
21
    protected $body;
22
23
    /**
24
     * TextNode constructor.
25
     * @param string $body
26
     */
27
    public function __construct(string $body)
28
    {
29
        $this->body = $body;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getBody(): string
36
    {
37
        return $this->body;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function __toString(): string
44
    {
45
        return $this->getBody();
46
    }
47
}
48