public changeRule ( string $rule, array $newFormat ) | ||
$rule | string | |
$newFormat | array |
public function changeRule($rule, array $newFormat)
{
$oldFormat = $this->get($rule);
$this->_rules[$rule] = array_merge($oldFormat, (array) $newFormat);
}
/** * @param array $newFormat * @param string $rule * @return $this * @throws \JBZoo\SimpleTypes\Exception */ public function changeRule($rule, array $newFormat) { $rule = $this->_parser->cleanRule($rule); $this->_formatter->changeRule($rule, $newFormat); $this->log('Rule "' . $rule . '" changed'); return $this; }