JBZoo\SimpleTypes\Formatter::changeRule PHP Method

changeRule() public method

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);
    }

Usage Example

Beispiel #1
0
 /**
  * @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;
 }