PHPHtmlParser\Dom\AbstractNode::__get PHP Method

__get() public method

Magic get method for attributes and certain methods.
public __get ( string $key ) : mixed
$key string
return mixed
    public function __get($key)
    {
        // check attribute first
        if (!is_null($this->getAttribute($key))) {
            return $this->getAttribute($key);
        }
        switch (strtolower($key)) {
            case 'outerhtml':
                return $this->outerHtml();
            case 'innerhtml':
                return $this->innerHtml();
            case 'text':
                return $this->text();
            case 'tag':
                return $this->getTag();
            case 'parent':
                $this->getParent();
        }
        return null;
    }