public function remove($type, $tagName = null)
	{
		if (preg_match('(^default(?:Child|Descendant)Rule)', $type))
		{
			throw new InvalidArgumentException('Cannot remove ' . $type);
		}

		if (isset($tagName))
		{
			$tagName = TagName::normalize($tagName);

			if (isset($this->items[$type]))
			{
				// Compute the difference between current list and our one tag name
				$this->items[$type] = array_diff(
					$this->items[$type],
					[$tagName]
				);

				if (empty($this->items[$type]))
				{
					// If the list is now empty, keep it neat and unset it
					unset($this->items[$type]);
				}
				else
				{
					// If the list still have names, keep it neat and rearrange keys
					$this->items[$type] = array_values($this->items[$type]);
				}
			}
		}
		else
		{
			unset($this->items[$type]);
		}
	}
public function remove($type, $tagName = null)
	{
		if (preg_match('(^default(?:Child|Descendant)Rule)', $type))
		{
			throw new InvalidArgumentException('Cannot remove ' . $type);
		}

		if (isset($tagName))
		{
			$tagName = TagName::normalize($tagName);

			if (isset($this->items[$type]))
			{
				// Compute the difference between current list and our one tag name
				$this->items[$type] = array_diff(
					$this->items[$type],
					[$tagName]
				);

				if (empty($this->items[$type]))
				{
					// If the list is now empty, keep it neat and unset it
					unset($this->items[$type]);
				}
				else
				{
					// If the list still have names, keep it neat and rearrange keys
					$this->items[$type] = array_values($this->items[$type]);
				}
			}
		}
		else
		{
			unset($this->items[$type]);
		}
	}
public function remove ( $ type , $ tagName = null ) { if ( preg_match ( '(^default(?:Child|Descendant)Rule)' , $ type ) ) { throw new InvalidArgumentException ( 'Cannot remove ' . $ type ) ; } if ( isset ( $ tagName ) ) { $ tagName = TagName :: normalize ( $ tagName ) ; if ( isset ( $ this -> items [ $ type ] ) ) { // Compute the difference between current list and our one tag name $ this -> items [ $ type ] = array_diff ( $ this -> items [ $ type ] , [ $ tagName ] ) ; if ( empty ( $ this -> items [ $ type ] ) ) { // If the list is now empty, keep it neat and unset it unset ( $ this -> items [ $ type ] ) ; } else { // If the list still have names, keep it neat and rearrange keys $ this -> items [ $ type ] = array_values ( $ this -> items [ $ type ] ) ; } } } else { unset ( $ this -> items [ $ type ] ) ; } }
Remove a specific rule, or all the rules of a given type

@param  string $type    Type of rules to clear
@param  string $tagName Name of the target tag, or none to remove all rules of given type
@return void
Remove a specific rule or all the rules of a given type