protected function buildHtmlString(array $attributesArray): string
    {
        $html = '';
        foreach ($attributesArray as $key => $attribute) {
            $spacer = strlen($html) ? ' ' : '';
            if ($key && is_string($key)) {
                $html .= $spacer . $key . ($attribute ? '="' . $attribute . '"' : '');
            } else {
                $html .= $spacer . $attribute;
            }
        }

        return $html;
    }