public function addClass( string $class ): Tag
    {

        if ( ! isset( $this->attributes['class'] ) ) {
            $this->attributes['class'] = $class;
        } else {
            $this->attributes['class'] .= " $class";
        }

        return $this;
    }
public function addClass( string $class ): Tag
    {

        if ( ! isset( $this->attributes['class'] ) ) {
            $this->attributes['class'] = $class;
        } else {
            $this->attributes['class'] .= " $class";
        }

        return $this;
    }
public function addClass ( string $ class ) : Tag { if ( ! isset ( $ this -> attributes [ 'class' ] ) ) { $ this -> attributes [ 'class' ] = $ class ; } else { $ this -> attributes [ 'class' ] .= " $class" ; } return $ this ; }
Convenience method to add a "class" to a tag.

@param string $class

@return Tag
Convenience method to add a class to a tag .