/*!
Returns modified attributes parameter
518719
protected function wordMatchSupport( $newTagName, $attributes, $attributeString )
    {
        $ini = eZINI::instance( 'wordmatch.ini' );
        if ( $ini->hasVariable( $newTagName, 'MatchString' ) )
        {
            $matchArray = $ini->variable( $newTagName, 'MatchString' );
            if ( $matchArray )
            {
                foreach ( array_keys( $matchArray ) as $key )
                {
                    $matchString = $matchArray[$key];
                    if (  preg_match( "/$matchString/i", $attributeString ) )
                    {
                        $attributes['class'] = $key;
                        unset( $attributes['style'] );
                    }
                }
            }
        }
        return $attributes;
    }
814779
function removeClassAttribute( $params )
    {
        $contentClassID = $params['class_id'];
        $classAttributeIdentifier = $params['attribute_identifier'];

        // get attributes of 'temporary' version as well
        $classAttributeList = eZContentClassAttribute::fetchFilteredList( array( 'contentclass_id' => $contentClassID,
                                                                                  'identifier' => $classAttributeIdentifier ),
                                                                           true );

        $validation = array();
        foreach( $classAttributeList as $classAttribute )
        {
            $dataType = $classAttribute->dataType();
            if( $dataType->isClassAttributeRemovable( $classAttribute ) )
            {
                $objectAttributes = eZContentObjectAttribute::fetchSameClassAttributeIDList( $classAttribute->attribute( 'id' ) );
                foreach( $objectAttributes as $objectAttribute )
                {
                    $objectAttributeID = $objectAttribute->attribute( 'id' );
                    $objectAttribute->removeThis( $objectAttributeID );
                }

                $classAttribute->removeThis();
            }
            else
            {
                $removeInfo = $dataType->classAttributeRemovableInformation( $classAttribute );
                if( $removeInfo === false )
                    $removeInfo = "Unknow reason";

                $validation[] = array( 'id' => $classAttribute->attribute( 'id' ),
                                       'identifier' => $classAttribute->attribute( 'identifier' ),
                                       'reason' => $removeInfo );
            }
        }

        if( count( $validation ) > 0 )
        {
            $this->reportError( $validation, 'eZSiteInstaller::removeClassAttribute: Unable to remove eZClassAttribute(s)' );
        }

    }
458914
final public static function parseAttributes($attributes, $ignore = array()) {
        if (!is_array($attributes)) {
            return $attributes;
        }
        $return = "";
        foreach ($attributes as $attr => $value) {
            if (in_array($attr, $ignore))
                continue;
            $return .= $attr . '="' . $value . '" ';
        }

        return $return;
    }
616554
function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement )
    {
        $operatorValue = str_replace( "\n",
                                      "<br />",
                                      $operatorValue );
    }
996776
function _getAttribute(attribute) {
    if (is_string(_attributes[attribute])) {
      return _attributes[attribute];
    }

    if ((line = _translator.trans(attribute)) !== attribute) {
      return line;
    } else {
      return attribute.replace('_', ' ');
    }
  }
1227703
public function getAttribute($key)
    {
        $value = parent::getAttribute($key);

        if ($key === 'name') {
            $value = str_replace($this->multiValueSuffix, '', $value);
        }

        return $value;
    }
219394
public function getAttributes($ignore = "")
    {
        $str = "";

        if (!empty($this->attributes)) {
            if (!is_array($ignore)) {
                $ignore = array($ignore);
            }

            $attributes = array_diff(array_keys($this->attributes), $ignore);

            foreach ($attributes as $attribute) {
                $str .= ' ' . $attribute;

                if ($this->attributes[$attribute] !== "") {
                    $str .= '="' . $this->filter($this->attributes[$attribute]) . '"';
                }
            }
        }

        return $str;
    }
455887
function normalizeAttributeKey(key) {
  const hyphenIndex = key.indexOf('-');

  if (hyphenIndex !== -1 && key.match(HTML_CUSTOM_ATTR_R) === null) {
    key = key.replace(CAPTURE_LETTER_AFTER_HYPHEN, function(_, letter) {
      return letter.toUpperCase();
    });
  }

  return key;
}
1295682
function getAttributeType (name, isDirective) {
  if (isDirective) {
    if (name === 'for') {
      return 'LIST_RENDERING'
    } else if (name === 'if' || name === 'else-if' || name === 'else' || name === 'show' || name === 'cloak') {
      return 'CONDITIONALS'
    } else if (name === 'pre' || name === 'once') {
      return 'RENDER_MODIFIERS'
    } else if (name === 'model') {
      return 'TWO_WAY_BINDING'
    } else if (name === 'on') {
      return 'EVENTS'
    } else if (name === 'html' || name === 'text') {
      return 'CONTENT'
    } else {
      return 'OTHER_ATTR'
    }
  } else {
    if (name === 'is') {
      return 'DEFINITION'
    } else if (name === 'id') {
      return 'GLOBAL'
    } else if (name === 'ref' || name === 'key' || name === 'slot') {
      return 'UNIQUE'
    } else {
      return 'OTHER_ATTR'
    }
  }
}
49089
private static function _parse_form_attributes($attributes, $default)
    {
        if (is_array($attributes)) {
            foreach ($default as $key => $val) {
                if (isset($attributes[$key])) {
                    $default[$key] = $attributes[$key];
                    unset($attributes[$key]);
                }
            }

            if (count($attributes) > 0) {
                $default = array_merge($default, $attributes);
            }
        }

        $att = '';

        foreach ($default as $key => $val) {
            if ($key == 'value') {
                $val = self::form_prep($val, $default['name']);
            }

            $att .= $key . '="' . $val . '" ';
        }

        return $att;
    }
514008
function objectAttributeContent( $contentObjectAttribute )
    {
        $dateTime = new eZDateTime();
        $stamp = $contentObjectAttribute->attribute( 'data_int' );
        $dateTime->setTimeStamp( $stamp );
        return $dateTime;
    }
297782
function    getJsFilterAttribute() {
        $filters = [];
        if ($this->deleted_at) {
            $filters[] = self::FILTER_SOFT_DELETE_YES;
        } else {
            $filters[] = self::FILTER_SOFT_DELETE_NO;
        }

        return $filters;
    }
11041
function getAttrMap(attrs)
{
	var i;
	var map = {};
	var numAttrs = attrs.length;
	
	for (i=0; i<numAttrs; i++)
	{
		map[ attrs[i].name ] = attrs[i].value;
	}
	
	return map;
}
577140
function filterAttributes (name, attributes) {
  const filtered = {}

  if (attributes.href) {
    filtered.href = attributes.href
  }

  return filtered
}
1232785
function attribute( $attr )
    {
        switch ( $attr )
        {
            case "original_filename":
                return $this->OriginalFilename;
            case "mime_type":
                return $this->Type;
            case "mime_type_category":
                return $this->MimeCategory;
            case "mime_type_part":
                return $this->MimePart;
            case "filename":
                return $this->Filename;
            case "filesize":
                return $this->Size;
            case "is_temporary":
                return $this->IsTemporary;
            default:
            {
                eZDebug::writeError( "Attribute '$attr' does not exist", __METHOD__ );
                return null;
            } break;
        }
    }
1222155
function attribute( $attr )
    {
        if ( isset( $this->Attributes[$attr] ) )
        {
            return $this->Attributes[$attr];
        }

        eZDebug::writeError( "Attribute '$attr' does not exist", __METHOD__ );
        $attributeData = null;
        return $attributeData;
    }
18622
function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace, &$currentNamespace, &$operatorValue, &$namedParameters ) {
        switch ($operatorName)
        {
            case 'washxml':
                $operatorValue = str_replace( array( '&', '"', "'", '<', '>' ), array( '&amp;', '&quot;', '&apos;', '&lt;', '&gt;' ), $operatorValue );
                break;
            case 'washxmlcomment':
                // in xml comments the -- string is not permitted
                $operatorValue = str_replace( '--', '_-', $operatorValue );
                break;
            case 'washxmlcdata':
                /// @todo
                eZDebug::writeWarning( 'Template operator washxmlcdata not yet implemented, it should not be used!', __METHOD__ );
                break;
            case 'xsdtype':
                $operatorValue = ggWSDLParser::phpType2xsdType( $operatorValue, $namedParameters['targetprefix'], $namedParameters['xsdprefix'], $namedParameters['soapencprefix'] );
                break;
            case 'classInspect':
                $operatorValue = ggeZWebservices::classInspect( $operatorValue );
                break;
        }
    }