Bluz\Validator\Validator::getError PHP Method

getError() public method

Get error message
public getError ( ) : false | string
return false | string
    public function getError()
    {
        // nothing for valid
        if (!sizeof($this->invalid)) {
            return false;
        }
        // one custom message for all rules in chain
        // or predefined message from last rule in chain
        if ($this->error) {
            $output = $this->error;
        } else {
            $output = end($this->invalid);
        }
        return $this->prepareError($output);
    }