Perform validation

@return boolean
176501
public function passes()
	{

		if ( ! count($this->errors))
		{
			foreach ($this->validators as $validator)
			{
				if ( ! $validator->validate() and $validator !== $this)
				{
					$this->errors->merge($validator->errors()->getMessages());
				}
			}
		}

		return (count($this->errors) > 0) ? false : true;
	}
69649
public function validate()
	{
		// reset the error container and status
		$this->errors = array();
		$this->isValid = true;

		// validation starts, call the pre-validation callback
		$this->runCallbacks('before_validation');

		// was the upload of the file a success?
		if ($this->container['error'] == 0)
		{
			// add some filename details (pathinfo can't be trusted with utf-8 filenames!)
			$this->container['extension'] = ltrim(strrchr(ltrim($this->container['name'], '.'), '.'),'.');
			if (empty($this->container['extension']))
			{
				$this->container['basename'] = $this->container['name'];
			}
			else
			{
				$this->container['basename'] = substr($this->container['name'], 0, strlen($this->container['name'])-(strlen($this->container['extension'])+1));
			}

			// does this upload exceed the maximum size?
			if ( ! empty($this->config['max_size']) and is_numeric($this->config['max_size']) and $this->container['size'] > $this->config['max_size'])
			{
				$this->addError(static::UPLOAD_ERR_MAX_SIZE);
			}

			// add mimetype information
			try
			{
				$handle = finfo_open(FILEINFO_MIME_TYPE);
				$this->container['mimetype'] = finfo_file($handle, $this->container['tmp_name']);
				finfo_close($handle);
			}
			// this will only work if PHP errors are converted into ErrorException (like when you use FuelPHP)
			catch (\ErrorException $e)
			{
				$this->container['mimetype'] = false;
				$this->addError(UPLOAD_ERR_NO_FILE);
			}

			// make sure it contains something valid
			if (empty($this->container['mimetype']) or strpos($this->container['mimetype'], '/') === false)
			{
				$this->container['mimetype'] = 'application/octet-stream';
			}

			// split the mimetype info so we can run some tests
			preg_match('|^(.*)/(.*)|', $this->container['mimetype'], $mimeinfo);

			// check the file extension black- and whitelists
			if (in_array(strtolower($this->container['extension']), (array) $this->config['ext_blacklist']))
			{
				$this->addError(static::UPLOAD_ERR_EXT_BLACKLISTED);
			}
			elseif ( ! empty($this->config['ext_whitelist']) and ! in_array(strtolower($this->container['extension']), (array) $this->config['ext_whitelist']))
			{
				$this->addError(static::UPLOAD_ERR_EXT_NOT_WHITELISTED);
			}

			// check the file type black- and whitelists
			if (in_array($mimeinfo[1], (array) $this->config['type_blacklist']))
			{
				$this->addError(static::UPLOAD_ERR_TYPE_BLACKLISTED);
			}
			if ( ! empty($this->config['type_whitelist']) and ! in_array($mimeinfo[1], (array) $this->config['type_whitelist']))
			{
				$this->addError(static::UPLOAD_ERR_TYPE_NOT_WHITELISTED);
			}

			// check the file mimetype black- and whitelists
			if (in_array($this->container['mimetype'], (array) $this->config['mime_blacklist']))
			{
				$this->addError(static::UPLOAD_ERR_MIME_BLACKLISTED);
			}
			elseif ( ! empty($this->config['mime_whitelist']) and ! in_array($this->container['mimetype'], (array) $this->config['mime_whitelist']))
			{
				$this->addError(static::UPLOAD_ERR_MIME_NOT_WHITELISTED);
			}

			// validation finished, call the post-validation callback
			$this->runCallbacks('after_validation');
		}
		else
		{
			// upload was already a failure, store the corresponding error
			$this->addError($this->container['error']);
		}

		// set the flag to indicate we ran the validation
		$this->isValidated = true;

		// return the validation state
		return $this->isValid;
	}
1067137
public function Validate()
	{
		// force re-validation
		$this->ResetValidationErrors();

		$is_valid = (!$this->HasValidationErrors());

		// if validation fails, remove this object from the cache otherwise invalid values can
		// hang around and cause troubles.
		if (!$is_valid)
		{
			$this->_phreezer->DeleteCache(get_class($this), $this->GetPrimaryKeyValue());
		}

		return $is_valid;
	}
493546
protected function validate()
    {
        // If attributes are set, validate them.
        if (!empty($this->attributes)) {
            // It's possible that there are no rules for the attributes available.
            // If so, skip attribute validation.
            if (sizeof($this->getAttributeRules()) > 0) {
                $validate_attributes = new Validator($this->attributes);
                $validate_attributes->rules($this->getAttributeRules());

                // Validation failed to succeeed, show errors
                if (!$validate_attributes->validate()) {
                    echo 'Some attributes failed to pass the validator:';
                    foreach ($validate_attributes->errors() as $failed_attr) {
                        echo ' '. $failed_attr[0];
                    }
                    return false;
                }
            }
        }

        // If a value is set, validate it.
        if (array_key_exists('value', $this)) {
            // It's possible that there is no value rule set.
            // If so, skip value validation.
            if (sizeof($this->getValueRule()) > 0) {
                $validate_value = new Validator(['value' => $this->value]);
                $validate_value->rules($this->getValueRule());

                // Validation failed to succeeed, show errors
                if (!$validate_value->validate()) {
                    echo "The 'value' failed to pass the validator:";
                    foreach ($validate_value->errors() as $message) {
                        if (is_array($message)) {
                            $message = implode(',', $message);
                        }
                        echo ' '. strtolower($message);
                    }
                    return false;
                }
            }
        }

        return true;
    }
799739
public function validate() {
    $arrErrors = array();

    $arrErrors = $this->validateFields();

    if (sizeof($arrErrors) > 0) {
      foreach ($arrErrors as $error) {
        $this->clientErrorMessage .= $error . " * ";
      }
      return false;
    }

    return true;
  }
550788
public function validate() {
        $status = new ValidationResult();

        // Check if the form is loaded
        if (!$this->form instanceof \bootbuilder\Form) {
            $status->setError(true);
            return $status;
        }

        // Validate form controls (and panes)
        foreach ($this->form->getRawControls() as $nr => $control) {
            if(!$this->validateControl($control, $status)) {
                $status->setError(true);
                $control->setErrorState(true);
            }
            
            $this->form->replaceControl($nr, $control);
        }
        
        return $status;
    }
1085324
public function isValid() {
		
		$value = $this -> getValue();

		if(true === $this -> getValidateAsArray() && true === is_array($value)) {
			
			foreach($value as $val) {

				if(false === $this -> check($val)) {
					return false;
				}
			}
		}
		else {
			return $this -> check($value);
		}

		return true;
	}
52668
public function validate() {
        $validated = TRUE;

        foreach($this->getFormElements() as $name => $child) {
            $validated &= $child->validate();
        }

        $validated &= $this->fireEvent("Form\onValidate", [ $this->value, $this ], TRUE, FALSE);

        return (bool)$validated;
    }
967644
public function validate()
    {
        $value = $this->getValue();
        // Check if the element is required
        if (($this->required) && empty($value)) {
            $this->errors[] = 'This field is required.';
        }
        // Check field validators
        if (count($this->validators) > 0) {
            foreach ($this->validators as $validator) {
                if ($validator instanceof \Pop\Validator\ValidatorInterface) {
                    if (!$validator->evaluate($value)) {
                        if (!in_array($validator->getMessage(), $this->errors)) {
                            $this->errors[] = $validator->getMessage();
                        }
                    }
                } else if (is_callable($validator)) {
                    $result = call_user_func_array($validator, [$value]);
                    if (null !== $result) {
                        if (!in_array($result, $this->errors)) {
                            $this->errors[] = $result;
                        }
                    }
                }
            }
        }
        return (count($this->errors) == 0);
    }
1044063
public function isValid() {
        if ($this->isValid === null) $this->isValid = $this->validate();
        return $this->isValid;
    }
1258487
public function isValid()
    {
        $this->applyFilters();

        $this->validationMessage = null;

        foreach ($this->validators as $validator) {
            if (!$validator->isValid($this->translations)) {
                $this->validationMessage = $validator->getMessage();
                return false;
            }
        }

        return true;
    }
988817
public function validate()
    {
        $data     = $this->buildData();
        $response = $this->_connection->post(Urls::URL_QUERY, $this->getConnection()->json_encode_wrapper($data), []);

        return $response->getJson();
    }
425464
public function valid()
    {
        $this->jwt();
        
        $data = new ValidationData();
        
        if ($this->leeway != 0) {
          $data->setCurrentTime(time() + $this->leeway);
        }
        
        return $this->jwt->validate($data);
    }
1154548
public function validate()
    {
		$returnValue = true;
		
		if(!$this->forcedValid){
			foreach($this->validators as $validator){
				if(!$validator->evaluate($this->getRawValue())){
					$this->error[] = $validator->getMessage();
					$returnValue = false;
					common_Logger::d($this->getName().' is invalid for '.$validator->getName(), array('TAO'));
                    if ($this->isBreakOnFirstError()){
                        break;
                    }
				}
			}
		}

        return $returnValue;
    }
685599
protected function validate(){
		$valid = true;
		$message = null;
		$result = ValidationResult::create($valid, $message);
		return $result;
	}
313837
public function isValid()
    {
        $this->errorMessages = [];
        $this->validatorCollection->rewind();
        while ($this->validatorCollection->valid()) {
            $this->checkForErrors($this->validatorCollection->current());
            $this->validatorCollection->next();
        }
        $count = count($this->errorMessages);
        return $count == 0;
    }
544368
public function validate()
    {
        $result = new ValidateResult();

        if ($this->get('disabled')) {
            return $result;
        }

        if ($this->required && !$this->checkRequired()) {
            return $result->setMessage(sprintf('Field %s value not allow empty.', $this->getLabel()))
                ->setResult(ValidateResult::STATUS_REQUIRED)
                ->setField($this);
        }

        if ($this->value !== null && $this->value !== '' && $this->validator && !$this->checkRule()) {
            return $result->setMessage(sprintf('Field %s validate fail.', $this->getLabel()))
                ->setResult(ValidateResult::STATUS_FAILURE)
                ->setField($this);
        }

        return $result;
    }