Check if the given field is valid or not.
@return bool
@throws \Exception
966829
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;
        }

        if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
            return false;
        }

        if ($this->checkIfDomainExists) {
            $host = substr(strstr($value, '@'), 1);

            if (function_exists('getmxrr')) {
                $tmp = null;
                if (!getmxrr($host, $tmp)) {
                    // this will catch dns do not have an mx record.
                    if (!checkdnsrr($host, 'ANY')) {
                        // invalid!
                        return false;
                    }
                }
            } else {
                // tries to fetch the ip address,
                // but it returns a string containing the unmodified hostname on failure.
                if ($host == gethostbyname($host)) {
                    // host is still the same, thus invalid
                    return false;
                }
            }
        }

        return true;
    }
300666
public function valid() {
        $echoStr = app('request')->get('echostr');
        if (!is_null($echoStr)) {
            if ($this->checkSignature()) {
                exit($echoStr);
            }
            throw new \Exception('no access');
        }
        $encryptStr = '';
        if (app('request')->isPost()) {
            $data = (array)Xml::decode($this->xml, false);
            if ($this->encryptType != 'aes') {
                return $data;
            }
            $encryptStr = $data['Encrypt'];
        }
        if (!$this->checkSignature($encryptStr)) {
            throw new \Exception('no access');
        }
        return true;
    }
1233578
public function valid()
    {
        $fieldCount = count($this->record);
        return ($this->at >= 0 && $this->at < $fieldCount);
    }
437326
public function isValid()
    {
        if ($this->required && $this->field->getValue() == "") {
            return false;
        }

        // values not the same
        if ($this->field->getValue() != $this->getField2()->getValue()) {
            return false;
        }

        // if here, it's ok
        return true;
    }
517852
public function validateOrFail()
    {
        // Validate data
        $passed = $this->validate();

        // If validation failed,
        // we'll throw an exception
        if (! $passed) {
            throw new ValidationException($this->validator, $this->getErrorCodes());
        }

        return true;
    }
1374888
public function isValid()
    {
        /**
         * First, check if the upload is valid or not
         */
        if (!parent::isValid()) {
            return false;
        }

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

        // if here, we know that the field is uploaded.

        // check if it's an image, and get it's size
        $size = @getimagesize($value['tmp_name']);
        if ($size === false) {
            $this->setErrorMessage($this->messages['not_an_image']);
            return false;
        }
        list ($width, $height) = $size;

        /**
         * Validate the aspect ratio.
         */
        if (!$this->validateAspectRatio($width, $height)) {
            return false;
        }


        /**
         * Validate the proportions
         */
        if (!$this->validateSize($width, $height)) {
            return false;
        }

        // if here, everything is ok!
        return true;
    }
11653
public function isValid() {
        $valid = parent::isValid();
        if (!filter_var($this->getValue(), FILTER_VALIDATE_EMAIL)) {
            $valid = false;
        }
        
        return $valid;
    }
926865
public function isValid() {
		
		$valid = TRUE;
		
		foreach ($this->controls as $control) {
			
			if (!$control->validate()) {
				$valid = FALSE;
			}
			
		}
		
		return $valid;
		
	}
790900
public function valid($fields = array())
    {
        if (empty($fields)) {
            $fields = array_diff($this->getFields(), array($this->getIndex()));
        }
        foreach ($fields as $field) {
            $value = $this->getFieldValue($field);
            if (!empty($value)) {
                return true;
            }
        }
        return false;
    }
633489
public function valid()
    {
        if (!isset($this->keys[$this->index])) {
            return false;
        }

        $hasContent = $this->hasContentForKey($this->keys[$this->index], $this->content);

        if (!$hasContent && $this->throwOnNotReachable) {
            $message = sprintf('No current content contains new content at a key of "%s".', $this->keys[$this->index]);
            throw new PathNotReachableException($this->keys[$this->index], $message);
        }

        return $hasContent;
    }
693555
public function valid()
    {
        echo "\n", __METHOD__, "\n";
        $key = key($this->values);
        var_export($key);

        return ($key !== null && $key !== false);
    }
222468
public function isValid() : bool
    {
        if (false === $this->validated) {
            $this->validate();
        }
        return (count($this->validation_errors) === 0);
    }
498018
public function isValid()
    {
        $form = $this->field->getForm();

        $fields = $form->getFields();
        foreach ($fields as $field) {
            if ($field instanceof RadioButton) {
                if ($field->getName() == $this->field->getName()) {
                    if ($field->isChecked()) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
435976
public function valid()
    {
        if ($this->fileSize == 0) {
            return false;
        }

        if (feof($this->handle)) {
            return false;
        }

        $current = fgets($this->handle);

        if (trim($current) === '' && feof($this->handle)) {
            return false;
        } else {
            fseek($this->handle, $this->offset);
        }

        return true;
    }
757086
public function validate() {
        // Deny if rules array is empty
        if (empty($this->rules))
            return true;
        // If rules are invalid
        if (!is_array($this->rules))
            throw new \Exception("The rules must be an array of the validator|sanitize rules", 1);
        // Loop the rules
        foreach ($this->rules as $rule) {
            // Run rule
            $rule instanceof \Closure
                ? $rule($this)
                : call_user_func($rule, $this);
        }
        // Check the field is valid
        return !$this->hasError();
    }
644252
public function valid(): bool
    {
        if (!$this->isUsed) {
            $this->call
                ->addIterableEvent($this->callEventFactory->createUsed());

            if ($this->traversable instanceof IteratorAggregate) {
                $this->iterator = $this->traversable->getIterator();
            } else {
                $this->iterator = $this->traversable;
            }

            $this->isUsed = true;
        }

        if ($isValid = $this->iterator->valid()) {
            $this->key = $this->iterator->key();
            $this->value = $this->iterator->current();
        } else {
            $this->key = null;
            $this->value = null;
        }

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

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

        return $isValid;
    }
358495
public function isValid()
    {
        $singleAssertion = $this->validateNumAssertions();
        if (!$singleAssertion) {
            throw new Exception('Multiple assertions are not supported');
        }

        $validTimestamps = $this->validateTimestamps();
        if (!$validTimestamps) {
            throw new Exception('Timing issues (please check your clock settings)');
        }

        $objXMLSecDSig = new XMLSecurityDSig();

        $objDSig = $objXMLSecDSig->locateSignature($this->_document);
        if (!$objDSig) {
            throw new Exception('Cannot locate Signature Node');
        }
        $objXMLSecDSig->canonicalizeSignedInfo();
        $objXMLSecDSig->idKeys = array('ID');

        $objKey = $objXMLSecDSig->locateKey();
        if (!$objKey) {
            throw new Exception('We have no idea about the key');
        }

        try {
            $objXMLSecDSig->validateReference();
        } catch (Exception $e) {
            throw new Exception('Reference Validation Failed');
        }

        XMLSecEnc::staticLocateKeyInfo($objKey, $objDSig);

        $objKey->loadKey($this->_settings->idpPublicCertificate, false, true);

        return ($objXMLSecDSig->verify($objKey) === 1);
    }