Check if the given field is valid or not.
@return bool
@throws \Exception
357302
public function isValid()
    {
        $value = $this->field->getValue();

        if (is_array($value) || is_object($value)) {
            throw new \Exception("This validator only works on scalar types!");
        }

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        $match = preg_match($this->regex, $value);

        return $this->not ? !$match : $match;
    }
659039
public function isValid()
    {
        $rules    = [];
        $isValid  = true;
        $messages = [];

        foreach ($this->rules() as $fieldName => $spec) {
            $value = $this->post($fieldName);

            foreach ($spec as $specRules => $message) {
                if (!isset($rules[ $fieldName ])) {
                    $rules[ $fieldName ] = Rule::$specRules();
                } else {
                    $rules[ $fieldName ] = $rules[ $fieldName ]->$specRules();
                }

                if (!$rules[ $fieldName ]->validate($value)) {
                    $isValid                = false;
                    $messages[ $fieldName ] = $message;
                    break;
                }

                if (!in_array($fieldName, $this->validValues)) {
                    $this->validValues[ ] = $fieldName;
                }
            }
        }

        if (!$isValid || $this->session->getErrorsBag()->has()) {
            foreach ($messages as $name => $errors) {
                $this->session->getErrorsBag()->add($name, $errors);
            }
            throw new ValidationError($messages);
        }
    }
303236
public function validate(Validation $validation, $field) : bool
    {
        if (!is_string($field)) {
            throw new Exception(
                "Field name must be a string"
            );
        }



        $label = $this->getOption("label");

        if (empty($label)) {
            $label = $validation->getLabel($field);
        }



        $value = $validation->getValue($field);

        if ($this->isSetOption("allowEmpty") && empty($value)) {
            return true;
        }



        $uuidRegEx = "/^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[1-5][A-Z0-9]{3}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$/i";

        if (!preg_match($uuidRegEx, $value)) {
            $message = $this->getOption("message");

            if (empty($message)) {
                $message = "Field :field must be a valid UUID";
            }



            $replacePairs = [
                ":field" => $label,
            ];

            $validation->appendMessage(
                new Message(
                    strtr($message, $replacePairs),
                    $field,
                    "Uuid"
                )
            );

            return false;
        }



        $allowedVersions = $this->getOption("allowedVersions");

        if (empty($allowedVersions)) {
            $allowedVersions = [1, 2, 3, 4, 5];
        }



        if (!in_array(substr($value, 14, 1), $allowedVersions)) {
            $message = $this->getOption("messageVersion");

            if (empty($message)) {
                $message = "Field :field must be one of the following UUID versions: :versions";
            }



            $replacePairs = [
                ":field" => $label,
                ":versions" => implode(", ", $allowedVersions),
            ];

            $validation->appendMessage(
                new Message(
                    strtr($message, $replacePairs),
                    $field,
                    "Uuid"
                )
            );

            return false;
        }

        return true;
    }
1233578
public function valid()
    {
        $fieldCount = count($this->record);
        return ($this->at >= 0 && $this->at < $fieldCount);
    }
544932
public function valid()
    {

        if ($this->container['orderId'] === null) {
            return false;
        }
        if ($this->container['typeId'] === null) {
            return false;
        }
        if ($this->container['regionId'] === null) {
            return false;
        }
        if ($this->container['locationId'] === null) {
            return false;
        }
        if ($this->container['range'] === null) {
            return false;
        }
        $allowedValues = $this->getRangeAllowableValues();
        if (!in_array($this->container['range'], $allowedValues)) {
            return false;
        }
        if ($this->container['isBuyOrder'] === null) {
            return false;
        }
        if ($this->container['price'] === null) {
            return false;
        }
        if ($this->container['volumeTotal'] === null) {
            return false;
        }
        if ($this->container['volumeRemain'] === null) {
            return false;
        }
        if ($this->container['issued'] === null) {
            return false;
        }
        if ($this->container['state'] === null) {
            return false;
        }
        $allowedValues = $this->getStateAllowableValues();
        if (!in_array($this->container['state'], $allowedValues)) {
            return false;
        }
        if ($this->container['minVolume'] === null) {
            return false;
        }
        if ($this->container['walletDivision'] === null) {
            return false;
        }
        if ($this->container['walletDivision'] > 7) {
            return false;
        }
        if ($this->container['walletDivision'] < 1) {
            return false;
        }
        if ($this->container['duration'] === null) {
            return false;
        }
        if ($this->container['escrow'] === null) {
            return false;
        }
        return true;
    }
219164
public function valid(): bool
    {
        if (!$this->isUsed) {
            $this->call
                ->addIterableEvent($this->callEventFactory->createUsed());
            $this->isUsed = true;
        }

        $key = key($this->array);
        $isValid = null !== $key;

        if ($this->isConsumed) {
            return $isValid;
        }

        if ($isValid) {
            $this->call->addIterableEvent(
                $this->callEventFactory
                    ->createProduced($key, current($this->array))
            );
        } else {
            $this->call->setEndEvent($this->callEventFactory->createConsumed());
            $this->isConsumed = true;
        }

        return $isValid;
    }
494507
public function isValid()
    {
        foreach ($this->objects as $fileInfo) {
            // Before validation callback
            $this->applyCallback('beforeValidation', $fileInfo);

            // Check is uploaded file
            if ($fileInfo->isUploadedFile() === false) {
                $this->errors[] = sprintf(
                    '%s: %s',
                    $fileInfo->getNameWithExtension(),
                    'Is not an uploaded file'
                );
                continue;
            }

            // Apply user validations
            foreach ($this->validations as $validation) {
                try {
                    $validation->validate($fileInfo);
                } catch (\Upload\Exception $e) {
                    $this->errors[] = sprintf(
                        '%s: %s',
                        $fileInfo->getNameWithExtension(),
                        $e->getMessage()
                    );
                }
            }

            // After validation callback
            $this->applyCallback('afterValidation', $fileInfo);
        }

        return empty($this->errors);
    }
926865
public function isValid() {
		
		$valid = TRUE;
		
		foreach ($this->controls as $control) {
			
			if (!$control->validate()) {
				$valid = FALSE;
			}
			
		}
		
		return $valid;
		
	}
285794
protected function validateField()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->field->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('Field'));
            return false;
        }

        $this->setUpdating($data);
        return true;
    }
693580
public function valid()
    {
        try {
            $this->g->current();
            return $this->e === null && $this->g->valid() && $this->g->key() !== CoInterface::RETURN_WITH;
        } catch (\Throwable $e) {} catch (\Exception $e) {}
        $this->e = $e;
        return false;
    }
414324
public function is_valid() {
        $ret = false;

        if (is_null($this->deleteInsteadOfAppend) === false && is_null($this->subscriberIds) === false &&
            is_null($this->emails) === false
        ) {
            $ret = true;
        }

        return $ret;
    }
505677
public function valid()
    {

        $allowedValues = $this->getEventResponseAllowableValues();
        if (!in_array($this->container['eventResponse'], $allowedValues)) {
            return false;
        }
        return true;
    }
890671
public function is_valid() {
        $ret = false;

        if(is_null($this->name) === false && is_null($this->nullable) === false) {
            $ret = true;
        }

        return $ret;
    }
5477
public function valid() : bool
    {
        if ($this->privateErrors()) {
            return false;
        }
        foreach ((array)$this as $element) {
            if (is_string($element)) {
                continue;
            }
            if (!$element->getElement()->valid()) {
                return false;
            }
        }
        return true;
    }
1368113
public function isValid()
    {
        $value = $this->field->getValue();

        if ($value == '' && $this->required == false) {
            return true;
        }

        if (filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            return true;
        }

        return false;
    }
1259208
public function valid()
    {

        if ($this->container['date'] === null) {
            return false;
        }
        if ($this->container['refId'] === null) {
            return false;
        }
        if ($this->container['refType'] === null) {
            return false;
        }
        $allowedValues = $this->getRefTypeAllowableValues();
        if (!in_array($this->container['refType'], $allowedValues)) {
            return false;
        }
        $allowedValues = $this->getFirstPartyTypeAllowableValues();
        if (!in_array($this->container['firstPartyType'], $allowedValues)) {
            return false;
        }
        $allowedValues = $this->getSecondPartyTypeAllowableValues();
        if (!in_array($this->container['secondPartyType'], $allowedValues)) {
            return false;
        }
        return true;
    }
867896
public function valid(): bool
    {
        $key = key($this->collection);

        return $key !== null && $key !== false;
    }