src/validator/Validation.php
protected function evaluateResult($field, $result, $message)
    {
        $this->messages = [];
        if ($result) {
            return true;
        } else {
            if (is_array($field['name'])) {
                foreach ($field['name'] as $name) {
                    $this->messages[$name][] = $field['options']['message'] ?? $message;
                }
            } else {
                $this->messages[$field['name']][] = $field['options']['message'] ?? $message;
            }
            return false;
        }
    }
protected function evaluateResult($field, $result, $message)
    {
        $this->messages = [];
        if ($result) {
            return true;
        } else {
            if (is_array($field['name'])) {
                foreach ($field['name'] as $name) {
                    $this->messages[$name][] = $field['options']['message'] ?? $message;
                }
            } else {
                $this->messages[$field['name']][] = $field['options']['message'] ?? $message;
            }
            return false;
        }
    }
protected function evaluateResult ( $ field , $ result , $ message ) { $ this -> messages = [ ] ; if ( $ result ) { return true ; } else { if ( is_array ( $ field [ 'name' ] ) ) { foreach ( $ field [ 'name' ] as $ name ) { $ this -> messages [ $ name ] [ ] = $ field [ 'options' ] [ 'message' ] ?? $ message ; } } else { $ this -> messages [ $ field [ 'name' ] ] [ ] = $ field [ 'options' ] [ 'message' ] ?? $ message ; } return false ; } }
Utility function that evaluates the result of a validation test and prepares validation messages.
Receives a boolean from the validation function and a message to be displayed when the value is false. It also
receives the options array so it could override the standard message that the validation code generates.

@param array $field
@param boolean $result
@param string $message
@return boolean
Utility function that evaluates the result of a validation test and prepares validation messages . Receives a boolean from the validation function and a message to be displayed when the value is false . It also receives the options array so it could override the standard message that the validation code generates .