private static function buildAttribArrayVal($key, $value = array())
    {
        if ($key == 'class') {
            if (!\is_array($value)) {
                $value = \explode(' ', $value);
            }
            $value = \array_filter(\array_unique($value));
            \sort($value);
            $value = \implode(' ', $value);
        } elseif ($key == 'style') {
            $keyValues = array();
            foreach ($value as $k => $v) {
                $keyValues[] = $k.':'.$v.';';
            }
            \sort($keyValues);
            $value = \implode('', $keyValues);
        } else {
            $value = null;
        }
        return $value;
    }