src/Node.php
public function getOpeningTag(): string
    {
        $attributes = [];

        foreach ($this->attributes as $name => $value) {
            $attributes[] = self::getHtmlAttribute($name, $value);
        }

        $attributes = implode(' ', array_filter($attributes));

        return sprintf('<%s%s>', $this->nodeName, $attributes === '' ? '' : " {$attributes}");
    }
public function getOpeningTag(): string
    {
        $attributes = [];

        foreach ($this->attributes as $name => $value) {
            $attributes[] = self::getHtmlAttribute($name, $value);
        }

        $attributes = implode(' ', array_filter($attributes));

        return sprintf('<%s%s>', $this->nodeName, $attributes === '' ? '' : " {$attributes}");
    }
public function getOpeningTag ( ) : string { $ attributes = [ ] ; foreach ( $ this -> attributes as $ name => $ value ) { $ attributes [ ] = self :: getHtmlAttribute ( $ name , $ value ) ; } $ attributes = implode ( ' ' , array_filter ( $ attributes ) ) ; return sprintf ( '<%s%s>' , $ this -> nodeName , $ attributes === '' ? '' : " {$attributes}" ) ; }
Returns the html code of the opening tag.
Returns the html code of the opening tag .