src/Field.php
public function validate() {
        // Deny if rules array is empty
        if (empty($this->rules))
            return true;
        // If rules are invalid
        if (!is_array($this->rules))
            throw new \Exception("The rules must be an array of the validator|sanitize rules", 1);
        // Loop the rules
        foreach ($this->rules as $rule) {
            // Run rule
            $rule instanceof \Closure
                ? $rule($this)
                : call_user_func($rule, $this);
        }
        // Check the field is valid
        return !$this->hasError();
    }
public function validate() {
        // Deny if rules array is empty
        if (empty($this->rules))
            return true;
        // If rules are invalid
        if (!is_array($this->rules))
            throw new \Exception("The rules must be an array of the validator|sanitize rules", 1);
        // Loop the rules
        foreach ($this->rules as $rule) {
            // Run rule
            $rule instanceof \Closure
                ? $rule($this)
                : call_user_func($rule, $this);
        }
        // Check the field is valid
        return !$this->hasError();
    }
public function validate ( ) { // Deny if rules array is empty
 if ( empty ( $ this -> rules ) ) return true ; // If rules are invalid
 if ( ! is_array ( $ this -> rules ) ) throw new \ Exception ( "The rules must be an array of the validator|sanitize rules" , 1 ) ; // Loop the rules
 foreach ( $ this -> rules as $ rule ) { // Run rule
 $ rule instanceof \ Closure ? $ rule ( $ this ) : call_user_func ( $ rule , $ this ) ; } // Check the field is valid
 return ! $ this -> hasError ( ) ; }
Run the rule of the rules
Each rule can push error to the field or change the value of the field

@category Validation

@return boolean The result of validation
Run the rule of the rules Each rule can push error to the field or change the value of the field