protected function _addError($rule, $name, $options)
    {
        if (is_array($name)) {
            $options = $name;
            $name = null;
        }

        if (!($rule instanceof RuleInvoker)) {
            $rule = new RuleInvoker($rule, $name, $options);
        } else {
            $rule->setOptions($options)->setName($name);
        }

        return $rule;
    }
protected function _addError($rule, $name, $options)
    {
        if (is_array($name)) {
            $options = $name;
            $name = null;
        }

        if (!($rule instanceof RuleInvoker)) {
            $rule = new RuleInvoker($rule, $name, $options);
        } else {
            $rule->setOptions($options)->setName($name);
        }

        return $rule;
    }
protected function _addError ( $ rule , $ name , $ options ) { if ( is_array ( $ name ) ) { $ options = $ name ; $ name = null ; } if ( ! ( $ rule instanceof RuleInvoker ) ) { $ rule = new RuleInvoker ( $ rule , $ name , $ options ) ; } else { $ rule -> setOptions ( $ options ) -> setName ( $ name ) ; } return $ rule ; }
Utility method for decorating any callable so that if it returns false, the correct
property in the entity is marked as invalid.

@param callable $rule The rule to decorate
@param string $name The alias for a rule.
@param array $options The options containing the error message and field.
@return callable
Utility method for decorating any callable so that if it returns false the correct property in the entity is marked as invalid .