htmlFactory = $htmlFactory; } public function process( $element ) { $tags = $element->getTags(); if( ! in_array('hide', $tags) ){ return $element; } if( ! method_exists($element, 'addAttr') ){ $element = $this->htmlFactory->makeBlock( $element ); } $element ->addAttr('class', 'hc-hide') ; return $element; } }