public static function filterAttributes(Tag $tag, array $tagConfig, array $registeredVars, Logger $logger)
	{
		$attributes = [];
		foreach ($tagConfig['attributes'] as $attrName => $attrConfig)
		{
			$attrValue = false;
			if ($tag->hasAttribute($attrName))
			{
				$vars = [
					'attrName'       => $attrName,
					'attrValue'      => $tag->getAttribute($attrName),
					'logger'         => $logger,
					'registeredVars' => $registeredVars
				];
				$attrValue = self::executeAttributeFilterChain($attrConfig['filterChain'], $vars);
			}

			if ($attrValue !== false)
			{
				$attributes[$attrName] = $attrValue;
			}
			elseif (isset($attrConfig['defaultValue']))
			{
				$attributes[$attrName] = $attrConfig['defaultValue'];
			}
			elseif (!empty($attrConfig['required']))
			{
				$tag->invalidate();
			}
		}
		$tag->setAttributes($attributes);
	}
public static function filterAttributes(Tag $tag, array $tagConfig, array $registeredVars, Logger $logger)
	{
		$attributes = [];
		foreach ($tagConfig['attributes'] as $attrName => $attrConfig)
		{
			$attrValue = false;
			if ($tag->hasAttribute($attrName))
			{
				$vars = [
					'attrName'       => $attrName,
					'attrValue'      => $tag->getAttribute($attrName),
					'logger'         => $logger,
					'registeredVars' => $registeredVars
				];
				$attrValue = self::executeAttributeFilterChain($attrConfig['filterChain'], $vars);
			}

			if ($attrValue !== false)
			{
				$attributes[$attrName] = $attrValue;
			}
			elseif (isset($attrConfig['defaultValue']))
			{
				$attributes[$attrName] = $attrConfig['defaultValue'];
			}
			elseif (!empty($attrConfig['required']))
			{
				$tag->invalidate();
			}
		}
		$tag->setAttributes($attributes);
	}
public static function filterAttributes ( Tag $ tag , array $ tagConfig , array $ registeredVars , Logger $ logger ) { $ attributes = [ ] ; foreach ( $ tagConfig [ 'attributes' ] as $ attrName => $ attrConfig ) { $ attrValue = false ; if ( $ tag -> hasAttribute ( $ attrName ) ) { $ vars = [ 'attrName' => $ attrName , 'attrValue' => $ tag -> getAttribute ( $ attrName ) , 'logger' => $ logger , 'registeredVars' => $ registeredVars ] ; $ attrValue = self :: executeAttributeFilterChain ( $ attrConfig [ 'filterChain' ] , $ vars ) ; } if ( $ attrValue !== false ) { $ attributes [ $ attrName ] = $ attrValue ; } elseif ( isset ( $ attrConfig [ 'defaultValue' ] ) ) { $ attributes [ $ attrName ] = $ attrConfig [ 'defaultValue' ] ; } elseif ( ! empty ( $ attrConfig [ 'required' ] ) ) { $ tag -> invalidate ( ) ; } } $ tag -> setAttributes ( $ attributes ) ; }
Filter the attributes of given tag

@private

@param  Tag    $tag            Tag being checked
@param  array  $tagConfig      Tag's config
@param  array  $registeredVars Array of registered vars for use in attribute filters
@param  Logger $logger         This parser's Logger instance
@return void
Filter the attributes of given tag