Evaluate any Closure attributes on the attribute array.

@param array $attributes

@return array
6947
protected function callClosureAttributes(array $attributes)
    {
        foreach ($attributes as &$attribute) {
            $attribute = $attribute instanceof Closure
                ? $attribute($attributes) : $attribute;
        }

        return $attributes;
    }
384650
protected function nullableFromArray(array $attributes = [])
    {
        if (is_array($this->nullable) && count($this->nullable) > 0) {
            return array_intersect_key($attributes, array_flip($this->nullable));
        }

        // Assume no fields are nullable
        return [];
    }
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;
    }
32853
private static function extractAttributes(array $attributes = []): string
    {
        $extracted = [];
        if (\count($attributes) > 0) {
            foreach ($attributes as $name => $value) {
                if ($name != 'id' || ($name == 'id' && $value != '')) {
                    $extracted[] = sprintf(
                        '%s="%s"',
                        \strtolower($name),
                        \htmlspecialchars((string)$value, ENT_COMPAT | ENT_HTML5)
                    );
                }
            }
            return \sprintf(' %s', \implode(' ', $extracted));
        }
        return '';
    }
467306
protected function mutableAttributesToArray(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            if ($this->hasGetterMutator($key)) {
                $attributes[$key] = $this->mutableMutate($key, $value, 'getter');
            }
        }

        return $attributes;
    }
277233
public static function arrayToAttributes(array $attributes)
	{
		//Build a list of single attributes first
		$attributeList = array();

		foreach ( $attributes as $key => $value )
		{
			// If the value is not false add the attribute. This allows attributes to not be shown.
			if ( $value !== false )
			{
				if ( is_string($key) )
				{
					$attributeList[] = htmlspecialchars($key) . '="' . htmlspecialchars($value) . '"';
				}
				else
				{
					$attributeList[] = $value;
				}
			}
		}

		return implode(' ', $attributeList);
	}
586908
public static function mapAttributes($attributes)
    {
        return ' '.join(' ', array_map(
            function ($sKey) use ($attributes) {
                return is_bool($attributes[$sKey]) ? ($attributes[$sKey] ? $sKey : '') : $sKey.'="'.$attributes[$sKey].'"';
            }, array_keys($attributes)
        ));
    }
1281725
protected function getArrayble($attributes = [])
    {
        if(is_array($attributes))
        {
            return $attributes;
        } elseif($attributes instanceof self)
        {
            return $attributes->all();
        }elseif($attributes instanceof ArrayInterface)
        {
            return $attributes->toArray();
        }elseif($attributes instanceof JsonInterface)
        {
            return json_decode($attributes->toJson(), true);
        }elseif($attributes instanceof JsonSerialize)
        {
            return $attributes->jsonSerialize();
        }
        elseif($attributes instanceof \Traversable)
        {
            return iterator_to_array($attributes);
        }

        return (array) $attributes;
    }
872315
public function get($attributes)
    {
        //get function args
        $argsAsArray = func_get_args();
        //is attributes passed as args is an array and count greater than 1
        if (!is_array($attributes) && count($argsAsArray) > 1) {
            //recalls itself to get attributes as array
            return call_user_func([get_class(), 'get'], $argsAsArray);
        }
        //if just args is not an array or comma separated list
        if (!is_array($attributes) && count($argsAsArray) == 1) {
            return isset($this->{$attributes}) ? $this->{$attributes} : null;
        }

        $attributesGet = [];
        foreach ($attributes as $attribute) {
            $attributesGet[$attribute] = isset($this->{$attribute}) ? $this->{$attribute} : null;
        }

        return $attributesGet;
    }
1098182
public static function mapAttributes($attributes)
    {
        return ' '.implode(' ', array_map(
            function ($sKey) use ($attributes) {
                return is_bool($attributes[$sKey]) ? ($attributes[$sKey] ? $sKey : '') : $sKey.'="'.$attributes[$sKey].'"';
            }, array_keys($attributes)
        ));
    }
115048
protected function generateAttributes(array $attributes)
	{
		if (isset($attributes['style']) && is_array($attributes['style']))
		{
			$attributes['style'] = $this->generateStyle($attributes['style']);
		}

		ksort($attributes);
		$xsl = '';
		foreach ($attributes as $attrName => $attrValue)
		{
			$innerXML = (strpos($attrValue, '<xsl:') !== false) ? $attrValue : AVTHelper::toXSL($attrValue);

			$xsl .= '<xsl:attribute name="' . htmlspecialchars($attrName, ENT_QUOTES, 'UTF-8') . '">' . $innerXML . '</xsl:attribute>';
		}

		return $xsl;
	}
629
protected function get_html_attributes( array $attributes ) {
		$html_attributes = '';
		if ( ! empty( $attributes ) ) {
			foreach ( $attributes as $attr => $val ) {
				$html_attributes .= \esc_attr( $attr ) . '="' . \esc_attr( $val ) . '" ';
			}
		}

		return $html_attributes;
	}
514680
protected function buildAttributes($attributes)
    {
        if ( ! $attributes) {
            return;
        }

        $attributeMap = [];
        foreach ($attributes as $attribute => $value) {
            $attributeMap[] = $attribute . '="' . $value . '"';
        }

        return implode($attributeMap, ' ');
    }
788107
protected function _cleanAttrs(array $attrs = array())
    {
        foreach ($attrs as $key => $val) {
            if (Arr::in($key, $this->_disallowAttr)) {
                unset($attrs[$key]);
            }
        }

        return $attrs;
    }
1323195
public function toArray($attributes = null)
    {
        $result = null;

        $excluded_attributes = self::$_manager->getExcludedAttributes($this);

        if (is_null($attributes)) {
            $result = get_object_vars($this);
        } else {
            $result = array_intersect_key(get_object_vars($this), $attributes);
        }        

        foreach ($excluded_attributes as $excluded_attribute) { 
            unset($result[$excluded_attribute]);
        }

        if (in_array('_last', $result)) {
            unset($result['_last']);
        }
        
        foreach ($result as $key => $value) { 
            if (empty($value)) { 
                unset($result[$key]);
            }
        }

        return $result;
    
    }
1148070
protected function mergeDefaultAttributes(array $attributes)
    {
        if ($this->schema && !empty($this->schema->getDefaultValues())) {
            $attributes = array_merge($this->schema->getDefaultValues(), $attributes);
        }

        return $attributes;
    }
937207
public static function attributes(array $attributes = null) {
        $attributes = (array)$attributes;
        $output = '';
        foreach ($attributes as $name => $value) {
            $output .= self::attribute($name, $value);
        }
        return $output;
    }