public function addRule($name, callable $rule)
    {
        if (isset($this[self::rule($name)])) {
            throw new \RuntimeException("rule '$name' already exists'");
        }
        $this[self::rule($name)] = $this->protect($rule);
    }
public function addRule($name, callable $rule)
    {
        if (isset($this[self::rule($name)])) {
            throw new \RuntimeException("rule '$name' already exists'");
        }
        $this[self::rule($name)] = $this->protect($rule);
    }
public function addRule ( $ name , callable $ rule ) { if ( isset ( $ this [ self :: rule ( $ name ) ] ) ) { throw new \ RuntimeException ( "rule '$name' already exists'" ) ; } $ this [ self :: rule ( $ name ) ] = $ this -> protect ( $ rule ) ; }
Add an augmentation rule.

@param string $name the name of the augmentation rule
@param callable $rule the code that will be executed
@throws \RuntimeException
Add an augmentation rule .