Set booleans if validator failed

@return void
188643
public function hasFailed()
    {
        if($this->failed == false || $this->passed == true)
        {
            $this->failed = true;
            $this->passed = false;
        }
    }
878210
function setValidation($row1, $col1, $row2, $col2, $validator)
    {
        $this->_dv[] = $validator->_getData() .
                       pack("vvvvv", 1, $row1, $row2, $col1, $col2);
    }
768022
protected function validateArgs(): void
    {
        if (! $this->rules) {
            return;
        }

        $validator = validator(
            $this->args,
            $this->rules,
            $this->messages,
            [
                'root' => $this->root,
                'context' => $this->context,
                // This makes it so that we get an instance of our own Validator class
                'resolveInfo' => $this->resolveInfo,
            ]
        );

        if ($validator->fails()) {
            foreach ($validator->errors()->getMessages() as $key => $errorMessages) {
                foreach ($errorMessages as $errorMessage) {
                    $this->validationErrorBuffer->push($errorMessage, $key);
                }
            }
        }

        $path = implode(
            '.',
            $this->resolveInfo()->path
        );
        $this->validationErrorBuffer->flush(
            "Validation failed for the field [$path]."
        );

        // reset rules and messages
        $this->rules = [];
        $this->messages = [];
    }
481755
def validate(self):
        
        super(BoolFilter, self).validate()

        self._value = truth(str(self._value), self._condition)
        self._condition = "yes" if self._value else "no"
405694
public function setFailQueryFailed(bool $fail_query_failed = true) : void
    {
        $this->query_succeeded = false;
        $this->fail_query_failed = $fail_query_failed;
    }
1036455
function setError( $connection = false )
    {
        if ( $this->IsConnected )
        {
            if ( $connection === false )
                $connection = $this->DBConnection;

            if ( $connection instanceof MySQLi )
            {
                $this->ErrorMessage = mysqli_error( $connection );
                $this->ErrorNumber = mysqli_errno( $connection );
            }
        }
        else
        {
            $this->ErrorMessage = mysqli_connect_error();
            $this->ErrorNumber = mysqli_connect_errno();
        }
    }
1047083
protected function setErrorHandlers()
  {
    # Report all PHP errors (see changelog)
    $this->errorLevel = \error_reporting( E_ALL | E_STRICT);

    # set to the user defined error handler
    $old_error_handler = \set_error_handler(array($this,'errorHandler'), E_ALL);
    $old_exception_handler = \set_exception_handler(array($this,'exceptionHandler'));

    $this->getLogger()->debug('Error handlers set');

    return true;
  }
1165983
public function validate()
	{
		$varValue = $this->getPost($this->strName);

		if (!empty($varValue) && !$this->isValidOption($varValue))
		{
			$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], (is_array($varValue) ? implode(', ', $varValue) : $varValue)));
		}

		parent::validate();
	}
1339676
public function setupDefaultValidation() {
		$validator = $this->_table->getValidator('default');
		$validator = $this->validationUserName($validator);
		$validator = $this->validationPassword($validator);
		$validator = $this->validationConfirmPassword($validator);
		$this->validationEmail($validator);
	}
1113914
def validate(self, value) :
        """"""
        for v in self.validators :
            v.validate(value)
        return True
257224
def set_valid(self, boolean):
        '''
        
        '''
        old_state = self.is_valid()
        self.valid_file = boolean

        if old_state != self.valid_file:
            self.call_valid(self.valid_file)
691185
public function setBoolean($boolean = null)
    {
        $this->boolean = null !== $boolean ? (bool) $boolean : null;

        return $this;
    }
617452
def validate(self):
        """"""
        if self.error:
            return False

        for v in self.validators:
            self.error = v(self.value)
            if self.error:
                return False

        return True
365749
protected function _setValidator($validator)
    {
        if (!is_null($validator) && !($validator instanceof ValidatorInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid validator'), null, null, $validator);
        }

        $this->validator = $validator;
    }
1103335
public function fails()
    {
        if (!($this->validator instanceof \Illuminate\Validation\Validator)) {
            throw new LogicException('No model was set. Nothing to validate.');
        }

        return $this->getValidator()->fails();
    }
537428
public function validate()
    {
        foreach ($this->fieldSet as $name => $field) {
            $field->validate();

            if (!$field->isValid()) {
                $this->valid = false;
            }
        }

        $this->validated = true;
    }
369459
public function validate()
    {
        foreach ($this->inputValidations as $name => $data) {
            $validator = $data['callback'];
            $result = $validator($this);
            if ($result === false) {
                $this->logDebug("Validation FAILED: $name");
                $onError = $data['soundOnError'];
                if (is_array($onError)) {
                    foreach ($onError as $msg) {
                        $this->addPrePromptMessage($msg);
                    }
                } elseif (is_string($onError)) {
                    $this->addPrePromptMessage($onError);
                } else {
                    $this->logDebug("Ignoring validation sound: " . print_r($onError, true));
                }
                return false;
            }
            $this->logDebug("Validation OK: $name");
        }
        return true;
    }