Validates value

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

        switch ($this->options['type']) {
            case 'equals':
                $isValid = $this->validateEquals();
                break;
            case 'lower-than':
                $isValid = $this->validateLowerThan();
                break;
            case 'greater-than':
                $isValid = $this->validateGreaterThan();
                break;
            default:
                $isValid = $this->validateEquals();
                break;
        }

        return $isValid;
    }
957631
protected static function processUNum(&$value, $options)
    {
        if (!isset($options['min']) || empty($options['min']) || $options['min'] < 0) {
            $options['min'] = 0;
        }
        self::processNum($value, $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;
        }
    }
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;
    }
53632
protected function validateRequired( $value )
	{
		if( is_string( $value )) {
			$value = trim( $value );
		}
		return is_null( $value ) || empty( $value )
			? false
			: true;
	}
478895
public function check($value, $hashedValue, array $options = [])
    {
        return $this->driver()->check($value, $hashedValue, $options);
    }
1288265
public function isValid($value)
    {
        $ok = true;
        
        if (!preg_match('/^.*[0-9].*$/', $value) || 
            !preg_match('/^.*[a-zA-Z].*$/', $value)) {
            $this->error(self::SYNTAX);
            return false;
        }
        
        if (Text::strLen($value) < $this->options['min']) {
            $this->error(self::MIN);
            $ok = false;
        }
        
        if (Text::strLen($value) > $this->options['max']) {
            $this->error(self::MAX);
            $ok = false;
        }

        return $ok;
    }
450703
protected function isValid($value)
    {
        if (is_null($value)) {
            return;
        } elseif ($value) {
            $context = [$value];
        } else {
            $context = [];
        }

        $q = new FlowQuery($context);

        if ($q->is('[instanceof ' . $this->options['type'] . ']')) {
            return;
        }

        $this->addError('The value is expected to satisfy the %s flowQuery condition.', 1515144113, [
            $this->options['type']
        ]);
    }
1238599
public static function password($name, $value = null, array $options = [])
    {
        self::exclure($options);

        return self::input('password', $name, $value, $options);
    }
663211
protected static function validateOptions(array $options = []): void
    {
        if (empty($options)) {
            return;
        }

        $validOptions = [
            'save_path',
            'name',
            'save_handler',
            'auto_start',
            'gc_probability',
            'gc_divisor',
            'gc_maxlifetime',
            'serialize_handler',
            'cookie_lifetime',
            'cookie_path',
            'cookie_domain',
            'cookie_secure',
            'cookie_httponly',
            'use_strict_mode',
            'use_cookies',
            'use_only_cookies',
            'referer_check',
            'cache_limiter',
            'cache_expire',
            'use_trans_sid',
            'trans_sid_tags',
            'trans_sid_hosts',
            'sid_length',
            'sid_bits_per_character',
            'upload_progress.enabled',
            'upload_progress.cleanup',
            'upload_progress.prefix',
            'upload_progress.name',
            'upload_progress.freq',
            'upload_progress.min_freq',
            'lazy_write',
            'read_and_close'
        ];

        $keys = \array_keys($options);
        foreach ($keys as $key) {
            if (!\in_array($key, $validOptions, true)) {
                throw new SessionException('Incorrect option: ' . $key);
            }
        }
    }
50058
private static function validateFilter($value, $filter, $options, Validator $validator)
    {
        if (!is_string($value) || filter_var($value, $filter, $options) !== false) {
            return null;
        }

        // This workaround allows otherwise valid protocol relative urls to pass.
        // @see https://bugs.php.net/bug.php?id=72301
        if ($filter === FILTER_VALIDATE_URL && is_string($value) && strpos($value, '//') === 0) {
            if (filter_var('http:' . $value, $filter, $options) !== false) {
                return null;
            }
        }

        return error('The value must match the format {parameter}.', $validator);
    }
1093119
function isValid($value)
	{
		static $combined = null;
		if ($combined === null) {
			$combined = array_combine($this->members, $this->members);
		}
		return isset($combined[$value]);
	}
1199499
public static function isInteger($value, array $options = array())
    {
        if (!self::isNumber($value, $options)) {
            return false;
        }

        if (self::getInteger($value, $options) == self::getFloat($value, $options)) {
            return true;
        }

        return false;
    }
1211225
public function check($value, $hashedValue, array $options = [])
    {
        if (strlen($hashedValue) === 0) {
            return false;
        }

        return password_verify($value, $hashedValue);
    }
291682
function validate($value, $options = null)
    {
        $length = core_text::strlen($value);
        switch ($this->name) {
            case 'minlength': return ($length >= $options);
            case 'maxlength': return ($length <= $options);
            default:          return ($length >= $options[0] && $length <= $options[1]);
        }
    }
49740
public function isValid($value)
    {
        $this->_setValue($value);

        $options  = $this->getOptions();
        $callback = $this->getCallback();
        $args     = func_get_args();
        $options  = array_merge($args, $options);

        try {
            if (!call_user_func_array($callback, $options)) {
                $this->_error(self::INVALID_VALUE);
                return false;
            }
        } catch (Exception $e) {
            $this->_error(self::INVALID_CALLBACK);
            return false;
        }

        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;
    }