public function register($name, $class, $errorMessage = '', $labeledErrorMessage = '')
    {
        if (is_subclass_of($class, '\Sirius\Validation\Rule\AbstractRule')) {
            $this->validatorsMap[$name] = $class;
        }
        if ($errorMessage) {
            $this->errorMessages[$name] = $errorMessage;
        }
        if ($labeledErrorMessage) {
            $this->labeledErrorMessages[$name] = $labeledErrorMessage;
        }

        return $this;
    }
public function register($name, $class, $errorMessage = '', $labeledErrorMessage = '')
    {
        if (is_subclass_of($class, '\Sirius\Validation\Rule\AbstractRule')) {
            $this->validatorsMap[$name] = $class;
        }
        if ($errorMessage) {
            $this->errorMessages[$name] = $errorMessage;
        }
        if ($labeledErrorMessage) {
            $this->labeledErrorMessages[$name] = $labeledErrorMessage;
        }

        return $this;
    }
public function register ( $ name , $ class , $ errorMessage = '' , $ labeledErrorMessage = '' ) { if ( is_subclass_of ( $ class , '\Sirius\Validation\Rule\AbstractRule' ) ) { $ this -> validatorsMap [ $ name ] = $ class ; } if ( $ errorMessage ) { $ this -> errorMessages [ $ name ] = $ errorMessage ; } if ( $ labeledErrorMessage ) { $ this -> labeledErrorMessages [ $ name ] = $ labeledErrorMessage ; } return $ this ; }
Register a class to be used when creating validation rules

@param string $name
@param string $class

@return \Sirius\Validation\RuleFactory
Register a class to be used when creating validation rules