Tests if the given token value is valid.

@param $value The CSRF token value to test

@return bool

@see CsrfTokenManagerInterface::isTokenValid()
545870
public function isTokenValid($value)
    {
        $csrfToken = new CsrfToken($this->tokenId, $value);

        return $this->csrfTokenManager->isTokenValid($csrfToken);
    }
6298
public static function isTokenValid(string $token): bool
    {
        if (!static::hasTokenStored()) {
            return false;
        }

        $storedToken = static::getStoredToken();
        return $storedToken->getToken() === $token;
    }
658166
protected function validateCsrfToken($value = null, $id = 'bolt')
    {
        if (!$this->isCsrfTokenValid($value, $id)) {
            $this->abort(Response::HTTP_BAD_REQUEST, Trans::__('general.phrase.something-went-wrong'));
        }
    }
1290065
public function isValid($value)
    {
        $this->setValue($value);

        if (!$this->skipFormat && preg_match($this->pattern, $value) == false) {
            $this->error(self::INVALID_FORMAT);

            return false;
        }

        $value = preg_replace('/[^\d]+/i', '', $value);

        $soma = 0;
        for ($i = 0; $i < 8; $i++) {
            $soma += substr($value, $i, 1) * ($i + 2);
        }

        $soma = $soma % 11;
        $ultimoDigito = ($soma == 10) ? 0 : $soma;
        $digitoInformado = substr($value, strlen($value) - 1, strlen($value));

        if ($ultimoDigito != $digitoInformado) {
            $this->error(self::INVALID_DIGITS);

            return false;
        }

        return true;
    }
111836
public function isValueValid($value) {
		return $value instanceof Type\Place || $value instanceof Type\PostalAddress || $value instanceof DataType\TextType;
	}
299934
public function isValueValid($value) {
		return $value instanceof Type\MenuType || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
26167
public function isValid($value)
    {
        if (strlen($value) < 6) {
            $this->_error(self::INVALID_TOO_SHORT, "Password too short!");

            return false;
        } elseif (strlen($value) > 100) {
            $this->_error(self::INVALID_TOO_LONG, "Password too long!");

            return false;
        }

        return true;
    }
408918
public function validate($value = "")
    {
        if (is_null($value) && $this->isEmptyAllowed()) {
            return true;
        }

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

        return true;
    }
466898
public function isValid($value)
    {
        if (!is_string($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        $this->_setValue($value);
        if ($this->_encoding !== null) {
            $length = iconv_strlen($value, $this->_encoding);
        } else {
            $length = iconv_strlen($value);
        }

        if ($length < $this->_min) {
            $this->_error(self::TOO_SHORT);
        }

        if (null !== $this->_max && $this->_max < $length) {
            $this->_error(self::TOO_LONG);
        }

        if (count($this->_messages)) {
            return false;
        } else {
            return true;
        }
    }
682583
public function isValid($value)
    {
        $this->setValue($value);

        if (!$this->skipFormat && preg_match($this->pattern, $value) == false) {
            $this->error(self::INVALID_FORMAT);

            return false;
        }

        $digits = preg_replace('/[^\d]+/i', '', $value);

        $padroesFalsos = Array(11111111111111, 22222222222222, 33333333333333, 44444444444444, 55555555555555, 66666666666666, 77777777777777, 88888888888888, 99999999999999, 00000000000000);

        if (in_array($digits, $padroesFalsos)) {
            $this->error(self::INVALID_DIGITS);

            return false;
        }

        $firstSum = 0;
        $secondSum = 0;

        $firstSum += ( 5 * $digits{0}) + (4 * $digits{1}) + (3 * $digits{2}) + (2 * $digits{3});
        $firstSum += ( 9 * $digits{4}) + (8 * $digits{5}) + (7 * $digits{6}) + (6 * $digits{7});
        $firstSum += ( 5 * $digits{8}) + (4 * $digits{9}) + (3 * $digits{10}) + (2 * $digits{11});

        $firstDigit = 11 - fmod($firstSum, 11);

        if ($firstDigit >= 10) {
            $firstDigit = 0;
        }

        $secondSum += ( 6 * $digits{0}) + (5 * $digits{1}) + (4 * $digits{2}) + (3 * $digits{3});
        $secondSum += ( 2 * $digits{4}) + (9 * $digits{5}) + (8 * $digits{6}) + (7 * $digits{7});
        $secondSum += ( 6 * $digits{8}) + (5 * $digits{9}) + (4 * $digits{10}) + (3 * $digits{11});
        $secondSum += ( $firstDigit * 2);

        $secondDigit = 11 - fmod($secondSum, 11);

        if ($secondDigit >= 10) {
            $secondDigit = 0;
        }

        if (substr($digits, -2) != ($firstDigit . $secondDigit)) {
            $this->error(self::INVALID_DIGITS);

            return false;
        }

        return true;
    }
851213
public function isValid($value)
    {
        $result = preg_match('/(.+)/i', $value);
        if (!$result) {
            $this->addMessage('notEmpty');
        }
        return (boolean) $result;
    }
1259765
public function isValueValid($value) {
		return $value instanceof Type\CreativeWorkType || $value instanceof Type\HowToSectionType || $value instanceof Type\HowToStepType || $value instanceof DataType\TextType;
	}
620762
public function isValueValid($value) {
		return $value instanceof Type\Product || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
1215652
public function isValueValid($value) {
		return $value instanceof Type\PropertyValueType || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
849695
public static function isValid($value): bool
    {
        try {
            self::decode($value);

            return true;
        } catch (\Throwable $e) {
            return false;
        }
    }
1005228
public function isValid($value, $context = null)
    {
        if (empty($value)) {
            $this->error(self::MISSING_VALUE);
            return false;
        }

        $service = $this->getService();

        $res = $service->verify($value);
        if (! $res) {
            $this->error(self::ERR_CAPTCHA);
            return false;
        }

        if (! $res->isSuccess()) {
            $this->error(self::BAD_CAPTCHA);
            return false;
        }

        return true;
    }
10375
protected function checkValidity($value) : bool
    {
        if (preg_match(static::$regex, $value)) {
            return true;
        } elseif ('' === $value) {
            return true;
        } else {
            return false;
        }
    }