@param  array $attributes

@return array
189521
protected function parseAttributes(array $attributes)
	{
		if (isset($attributes['icon']) && $attributes['icon'] instanceof IconInterface) {
			$this->icon = $attributes['icon'];
		} else {
			/** @var IconInterface $resolver */
			foreach (static::$iconResolvers as $key => $resolver) {
				if (array_key_exists($key, $attributes)) {
					$this->icon = $resolver::createFromAttribute($attributes[$key]);
					break;
				}
			}
		}

		if (isset($attributes['class'])) {
			if (is_string($attributes['class'])) {
				$attributes['class'] = explode(' ', $attributes['class']);
			}
		} else {
			$attributes['class'] = [];
		}

		if (isset($attributes['suffix'])) {
			$this->suffix = $attributes['suffix'];
		}
		if (isset($attributes['prefix'])) {
			$this->prefix = $attributes['prefix'];
		}

		$attributes['id'] = isset($attributes['id']) ? $attributes['id'] : StringUtils::slug($this->title);

		return array_diff_key($attributes, array_flip(static::$notHtmlAttributes));
	}
221620
protected function attributes(array $attributes): string
	{
		$attr = '';

		foreach($attributes as $attribute => $value)
		{
			if(is_int($attribute))
			{
				$attribute = $value;
			}

			$attr .= ' ' . $attribute . '="' . $value . '"';
		}

		return $attr;
	}
301990
public function getOrCreate(array $attributes)
    {
        $model = $this->get($attributes);
        if (null === $model) {
            $className = get_class($this->getModel());
            /** @var Model $model */
            $model = new $className($attributes);
            $model->save();

            return [$model, true];
        }

        return [$model, false];
    }
57893
protected function applyDefaultAttrValues(array $attributes = [])
    {
        $attributes = parent::applyDefaultAttrValues($attributes);

        // Set defaults for the entire entity.
        foreach ($this->getMetadata()->defaultValues as $key => $value) {
            if (isset($attributes[$key])) {
                continue;
            }
            $attributes[$key] = $this->convertAttributeValue($key, $value);
        }
        return $attributes;
    }
69728
public static function sanitizeAttributeArray(array $attributes)
    {
        foreach ($attributes as $name => $values) {
            if (in_array(strtolower($name), self::MASK_ATTRIBUTES)) {
                $attributes[$name] = self::MASK_PASSWORD;
            } else {
                $replaced = false;
                $newValues = is_array($values) ? $values : [$values];
                foreach ($newValues as $i => $v) {
                    if (is_string($v) && self::isBinary($v)) {
                        $newValues[$i] = LdapUtilities::MASK_BINARY;
                        $replaced = true;
                    }
                }
                if ($replaced) {
                    $attributes[$name] = is_array($values) ? $newValues : reset($newValues);
                }
            }
        }

        return $attributes;
    }
1162461
protected function fillableFromArray(array $attributes)
    {
        if (! empty($attributes) && property_exists($this, 'defaults')) {
            $attributes = array_diff_assoc($attributes, $this->defaults);
        }

        return parent::fillableFromArray($attributes);
    }
213987
public function formatAttributes(array $attributes) {
        foreach ($attributes as $key => $attr) {
            if ($attr instanceof Closure) {
                $attributes[$key] = call_user_func($attr, $this);

            } else if ($this->hasKeyword($attr)) {
                $attributes[$key] = $this->getKeyword($attr);

            } else if ($attr === true) {
                $attributes[$key] = $this->getKeyword($key);

            } else {
                $attributes[$key] = (string) $attr;
            }
        }

        return $attributes;
    }
1100746
private function sanitizeAttributes(array $attributes)
    {
        $sanitizeAttributes = [];
        foreach ($attributes as $key => $value) {
            $key = $this->formatAttribute($key);
            if (isset($sanitizeAttributes[$key])) {
                if (!is_array($sanitizeAttributes[$key])) {
                    $sanitizeAttributes[$key] = [$sanitizeAttributes[$key]];
                }

                if (!is_array($value)) {
                    $value = [$value];
                }

                $value = $sanitizeAttributes[$key] + $value;
            }

            $sanitizeAttributes[$key] = $value;
        }

        return $sanitizeAttributes;
    }
54030
private function extractKeys($attributes, $keys)
    {
        if (!$keys) {
            $keys = array_keys($attributes);
        }

        if (!is_array($keys)) {
            $keys = (array) $keys;

            return $keys;
        }

        return $keys;
    }
48571
protected function filterAttributeValues(array $attributes)
    {
        return array_filter($attributes, function ($value) {
            if (is_array($value) && empty($value)) {
                return false;
            }

            return !($value === '' || $value === null);
        });
    }
861970
public static function attributes($attributes)
    {
        $buffer = '';

        foreach ($attributes as $name => $value) {
            $buffer .= ' ' . $name . '="' . static::attributeValue($value) . '"';
        }

        return $buffer;
    }
491708
public static function init(array $attributes) {
        $obj = new Attributes;
        foreach ($attributes as $attribute) {
            $obj->{$attribute->key} = $attribute;
        }
        return $obj;
    }
1146964
private function mapAttributeValues(array $attributes, Attribute $attribute)
    {
        $key = $attribute->getName();
        $value = $attribute->getAllAttributeValues();

        if (!array_key_exists($key, $attributes) && 1 === count($value)) {
            $value = array_shift($value);
        }

        if (array_key_exists($key, $attributes)) {
            $currentValue = (is_array($attributes[$key]) ? $attributes[$key] : [$attributes[$key]]);

            $value = array_merge($currentValue, $value);
        }

        $attributes[$key] = $value;

        return $attributes;
    }
486378
public static function attributes(array $attributes = array())
    {
        $text = array();
        foreach ($attributes as $key => $value) {
            //if we have numeric keys (e.g. checked), set the value as
            //the $key (e.g. checked="checked"), but only if it
            //doesn't exist already
            if (is_numeric($key)) {
                $value = htmlspecialchars($value);
                if (!isset($attributes[$value])) {
                    $text[] = $value . '="' . $value . '"';
                }
                continue;
            }
            $text[] = $key . '="' . htmlspecialchars($value) . '"';
        }

        return empty($text) ? '' : ' ' . implode(' ', $text);
    }
897165
public function attributes(array $attributes)
    {
        foreach ($attributes as $attribute => &$data) {
            $data = implode(' ', (array) $data);
            $data = $attribute . '="' . htmlspecialchars($data, ENT_QUOTES, 'UTF-8') . '"';
        }

        return empty($attributes) ? '' : ' ' . implode(' ', $attributes);
    }
274158
public function toCamelCase($attributes)
    {
        $convertedAttributes = [];

        foreach ($attributes as $key => $value) {
            $key = $this->getTrueKey($key);
            $convertedAttributes[$key] = $value;
        }

        return $convertedAttributes;
    }
963698
protected static function prepareAttributes($attributes)
    {
        $prepared = array();
        if (is_string($attributes)) {
            return self::parseAttributes($attributes);

        } elseif (is_array($attributes)) {
            foreach ($attributes as $key => $value) {
                if (is_int($key)) {
                    $key = strtolower($value);
                    $prepared[$key] = $key;
                } else {
                    $prepared[strtolower($key)] = (string)$value;
                }
            }
        }
        return $prepared;
    }