PHPHtmlParser\Dom\TextNode::__construct PHP Method

__construct() public method

Sets the text for this node.
public __construct ( string $text )
$text string
    public function __construct($text)
    {
        // remove double spaces
        $text = mb_ereg_replace('\\s+', ' ', $text);
        // restore line breaks
        $text = str_replace('
', "\n", $text);
        $this->text = $text;
        $this->tag = new Tag('text');
        parent::__construct();
    }