public function merge($rules, $overwrite = true)
	{
		if (!is_array($rules)
		 && !($rules instanceof self))
		{
			throw new InvalidArgumentException('merge() expects an array or an instance of Ruleset');
		}

		foreach ($rules as $action => $value)
		{
			if (is_array($value))
			{
				foreach ($value as $tagName)
				{
					$this->$action($tagName);
				}
			}
			elseif ($overwrite || !isset($this->items[$action]))
			{
				$this->$action($value);
			}
		}
	}
public function merge($rules, $overwrite = true)
	{
		if (!is_array($rules)
		 && !($rules instanceof self))
		{
			throw new InvalidArgumentException('merge() expects an array or an instance of Ruleset');
		}

		foreach ($rules as $action => $value)
		{
			if (is_array($value))
			{
				foreach ($value as $tagName)
				{
					$this->$action($tagName);
				}
			}
			elseif ($overwrite || !isset($this->items[$action]))
			{
				$this->$action($value);
			}
		}
	}
public function merge ( $ rules , $ overwrite = true ) { if ( ! is_array ( $ rules ) && ! ( $ rules instanceof self ) ) { throw new InvalidArgumentException ( 'merge() expects an array or an instance of Ruleset' ) ; } foreach ( $ rules as $ action => $ value ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ tagName ) { $ this -> $ action ( $ tagName ) ; } } elseif ( $ overwrite || ! isset ( $ this -> items [ $ action ] ) ) { $ this -> $ action ( $ value ) ; } } }
Merge a set of rules into this collection

@param array|Ruleset $rules     2D array of rule definitions, or instance of Ruleset
@param bool          $overwrite Whether to overwrite scalar rules (e.g. boolean rules)
Merge a set of rules into this collection