Validates value

@param null  $value
@param array $options
@return bool
771190
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        if (\strpos($this->value, '..') !== false || !\preg_match('/^(.+)@([^@]+)$/', $this->value, $matches)) {
            $this->setError(self::VALIDATOR_ERROR_EMAIL_INCORRECT_FORMAT);
            return false;
        }
        if (!\filter_var($this->value, FILTER_VALIDATE_EMAIL) !== false) {
            $this->setError(self::VALIDATOR_ERROR_EMAIL_INCORRECT_FORMAT);
            return false;
        }
        $host = $matches[2];
        if ($this->options['domain-check'] === true && @\gethostbyname($host) === $host) {
            $this->setError(self::VALIDATOR_ERROR_EMAIL_INVALID_DOMAIN);
            return false;
        }
        if ($this->options['mx-check'] === true) {
            return $this->mxCheck($host);
        }

        return true;
    }
276447
private function validate(array $options)
    {
        if (array_key_exists('mandatorId', $options)) {
            $options['mandatorId'] = (int) $options['mandatorId'];
        }

        list($customerId, $licenseKey) =
            $this->siteAccessHelper->getRecommendationServiceCredentials($options['mandatorId'], $options['siteaccess']);

        $options = array_filter($options, function ($val) {
            return $val !== null;
        });

        $resolver = new OptionsResolver();
        $resolver->setRequired(['contentTypeIdList', 'host', 'webHook', 'transaction']);
        $resolver->setDefined(array_keys($options));
        $resolver->setDefaults([
            'transaction' => (new \DateTime())->format('YmdHis') . rand(111, 999),
            'customerId' => $customerId,
            'licenseKey' => $licenseKey,
            'mandatorId' => null,
            'siteaccess' => null,
            'lang' => null,
        ]);

        return $resolver->resolve($options);
    }
1315430
function validate($value, $options = null)
    {
        if (isset($this->_data[$this->name])) {
            $callback = $this->_data[$this->name];
            if (isset($callback[1])) {
                return call_user_func(array($callback[1], $callback[0]), $value, $options);
            } elseif ($this->_BCMode[$this->name]) {
                return $callback[0]('', $value, $options);
            } else {
                return $callback[0]($value, $options);
            }
        } elseif (is_callable($options)) {
            return call_user_func($options, $value);
        } else {
            return true;
        }
    }
721765
protected function validateIs($value, string $parameter, array $args = [], array $rules = null, array $context = null): ?string
    {
        if (count($args) == 0) {
            throw new ValidatorConfigException("Validator 'is' must have argument in validator list for parameter {$parameter}");
        }

        //$value = $this->getValue($parameter);

        if ($value === null) {
            return null;
        }

        if (!is_scalar($value)) {
            return Message::getMessage(Message::PRIMITIVE, [
                'param' => $parameter
            ]);
        }

        $value = trim((string)$value);

        if ($value === '') {
            return null;
        }

        if ($value !== $args[0]) {
            return Message::getMessage(Message::IS, [
                'param' => $parameter,
                'value' => $value
            ]);
        }

        return null;
    }
743762
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        $validIP = $this->validateIPNumber();
        $validPrivRange = $this->validatePrivateRange();
        $validResRange = $this->validateReservedRange();

        return $validIP && $validPrivRange && $validResRange;
    }
60684
public function isValid($value = null, array $options = []): bool
    {
        $this->setOptions($options);
        $this->setValue($value);
        $this->errors = [];

        $this->options['stored-passwords'] = array_reverse($this->options['stored-passwords']);

        $lengthValid = $this->validateLength();
        $letterValid = $this->validateLetter();
        $lowercaseLetterValid = $this->validateLowercaseLetter();
        $uppercaseLetterValid = $this->validateUppercaseLetter();
        $numberValid = $this->validateNumber();
        $specialCharacterValid = $this->validateSpecialCharacter();
        $differentPrevOneValid = $this->validateDifferentPreviousOne();
        $differentPrevAllValid = $this->validateDifferentPreviousAll();

        return $lengthValid
            && $letterValid
            && $lowercaseLetterValid
            && $uppercaseLetterValid
            && $numberValid
            && $specialCharacterValid
            && $differentPrevOneValid
            && $differentPrevAllValid;
    }
461532
final public static function hasNumber ($value, array $options=[]) : bool
	{
		if (!self::hasValue($value))  new ErrorCode(1001);

		// Submitted values are strings, so use is_numeric instead of is_int
		if (!is_numeric($value)) return FALSE;

		if (!empty($options)) return static::hasLength($value, $options);

		return TRUE;
	}
580390
function validate($options = [])
    {
        $groups = @$options['groups'] ?: [];

        $this->errors = static::validator()->validate($this, $groups);

        return $this->errors->count() === 0;
    }
82388
public static function encode($value, $options = null)
    {
        if ($options === null) {
            $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
        }

        $json = json_encode($value, $options);

        static::handleJsonError(json_last_error());

        return $json;
    }
969382
public function submit($value = null, $options = [])
    {
        $classes = explode(' ', isset($options['class']) ? $options['class'] : '');

        if ( ! in_array('btn', $classes)) {
            $classes[] = 'btn';
        }
        if ( ! in_array('btn-default', $classes)
            && ! in_array('btn-primary', $classes)
            && ! in_array('btn-success', $classes)
            && ! in_array('btn-info', $classes)
            && ! in_array('btn-warning', $classes)
            && ! in_array('btn-danger', $classes)
            && ! in_array('btn-link', $classes)
        ) {
            $classes[] = 'btn-default';
        }

        $options['class'] = trim(implode(' ', $classes));

        return $this->plainInput('submit', null, $value, $options);
    }
110551
protected function validate($value)
    {
        return Match::on(Option::create($this->validator->isValid($value), false))
            ->Monad_Option_Some(true)
            ->Monad_Option_None(
                function () {
                    $msgs = $this->validator->getMessages();
                    array_walk(
                        $msgs, 
                        function ($msg) {
                            $this->messenger->add(new StringType($msg));
                        }
                    );
                    return false;
                }
            )
            ->value();
    }
42785
public static function uInt(&$value, $options = ['max'=>null, 'min'=>null, 'default'=>null])
    {
        $value = (int)$value;
        self::processUNum($value, $options);
        return $value;
    }
408918
public function validate($value = "")
    {
        if (is_null($value) && $this->isEmptyAllowed()) {
            return true;
        }

        if ($this->isNullNotAllowed() && is_null($value)) {
            return false;
        }

        return true;
    }
376219
public function validate($value, $options)
	{
		$this->value = $value;
		$this->options = $options;
		$this->errors = [];

		return $this->checkIt();
	}
803871
public function button( $value = null, $options = [] ) {
		if ( ! array_key_exists( 'type', $options ) ) {
			$options['type'] = 'button';
		}

		return $this->to_html_string( '<button' . $this->attributes( $options ) . '>' . $value . '</button>' );
	}
821654
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue(\str_replace(' ', '', (string)$value));
        $this->errors = [];

        if ($this->options['country-code'] !== null) {
            $newValue = \preg_match('/^[A-Z]{2}/', $this->value)
                ? \preg_replace('/^[A-Z]{2}/', $this->options['country-code'], $this->value)
                : $this->options['country-code'].$this->value;

            $this->setValue($newValue);
        }

        $countryCode = \substr($this->value, 0, 2);
        if (!\array_key_exists($countryCode, $this->patterns)) {
            throw new DomainException('Unsopported country code: '.$countryCode);
        }
        if ($this->options['allow-non-sepa'] === false && !\in_array($countryCode, $this->sepaCountries)) {
            $exMsg = 'Countries outside the Single Euro Payments Area (SEPA) are not supported';
            throw new DomainException($exMsg);
        }

        if (!\preg_match('/^'.$this->patterns[$countryCode].'$/', $this->value)) {
            $this->setError(self::VALIDATOR_ERROR_IBAN_INCORRECT_FORMAT);
            return false;
        }

        return $this->validateIban();
    }
183594
public function isValid($value) {
		if ($this->validator === null) {
			throw new ValidationFailure('Zend validator wasn\'t been suplied');
		}
		
		return $this->validator->isValid($value);
	}