/** * Get all attributes for current dom element * * @param \Magento\Framework\View\Layout\Element $element * @return array */ protected function getAttributes($element) { $attributes = []; foreach ($element->attributes() as $attrName => $attrValue) { $attributes[$attrName] = (string) $attrValue; } return $attributes; }