aboutsummaryrefslogtreecommitdiff
path: root/lib/exTpl/TextNode.php
blob: 053cafc04dc28746f96e2b18638e4e897ec34bdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

namespace exTpl;

/**
 * TextNode represents a verbatim text segment.
 */
class TextNode implements Node
{
    protected string $text;

    /**
     * Initializes a new Node instance with the given text.
     *
     * @param string $text verbatim text
     */
    public function __construct(string $text)
    {
        $this->text = $text;
    }

    /**
     * Returns a string representation of this node.
     *
     * @param Context $context symbol table
     */
    public function render(Context $context): string
    {
        return $this->text;
    }
}