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

TextNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getBody() 0 4 1
A __toString() 0 4 1
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