Field must contain a valid integer value.

@param string $message
@return FormValidator
484222
public function integer($message = null)
    {
        $this->setRule(__FUNCTION__, function($val)
                       {
                           return !(filter_var($val, FILTER_VALIDATE_INT) === FALSE);
                       }, $message);
        return $this;
    }
138507
public static function isInteger($value, $message = null)
    {
        if (!is_int($value)) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected integer, but got %s',
                Helper::typeToString($value)
            ));
        }
    }
735665
public function validate(Message $message)
    {
        if ($message->getTitleLength() > self::CHARACTER_LIMIT) {
            $message->addStatus(new SoftLimitTheTitleLengthTo50CharactersStatus());
        }
    }
382998
protected function throwValidationException(string $message, string $prefix = null)
    {
        throw new ValidationException($message, $this->name, $prefix);
    }
1350596
public static function invalidButtonPosition($message = null)
    {
        $defaultMessage = sprintf('Tried giving the button to a player that is not sat down.');
        $message = null === $message ? $defaultMessage : $message;

        return new static($message);
    }
1121329
public function respondValidationError($message = "Validation Error", $data = null)
    {
        return $this->setStatusCode(ResponseHTTP::HTTP_UNPROCESSABLE_ENTITY)
            ->respondWithError($message, null, $data);
    }
334273
public function addValidationMessage($rule, $message)
    {
        if (($pos = strpos($rule, ':')) !== false) {
            $rule = substr($rule, 0, $pos);
        }

        $this->validationMessages[$rule] = $message;

        return $this;
    }
860977
protected function addElementError($message)
    {
        if ($this->element === null) {
            throw new \RuntimeException('Create a form element prior to adding a validation error', 1519731421);
        }
        $this->addError($this->element->getIdentifier(), $message);
    }
1100481
protected function validate($value)
    {
        if (!parent::validate($value)) {
            return false;
        }

        if (count($value) < $this->min) {
            $this->messenger->add(new StringType(self::ERR_MIN));
            return false;
        }

        if ($this->max !== -1 && (count($value) > $this->max)) {
            $this->messenger->add(new StringType(self::ERR_MAX));
            return false;
        }

        $validator = $this->validator;
        foreach ($value as $k => $v) {
            if (!$validator($v, $this->messenger)) {
                $this->messenger->add(new StringType(sprintf(self::ERR_ITEM, (string)$k)));
                return false;
            }
        }

        return true;
    }
488773
public static function invalidArgument($message = null)
    {
        $defaultMessage = sprintf('Invalid argument passed in GameParameters.');
        $message = null === $message ? $defaultMessage : $message;

        return new static($message);
    }
949090
public function addValidationRule($rule, $message = null)
    {
        $uploadRules = ['file', 'image', 'mime', 'size', 'dimensions', 'max', 'min', 'between'];

        foreach ($uploadRules as $uploadRule) {
            if (strpos($rule, $uploadRule) !== false) {
                $this->uploadValidationRules[] = $rule;

                if (is_null($message)) {
                    return $this;
                }

                return $this->addValidationMessage($rule, $message);
            }
        }

        return parent::addValidationRule($rule, $message);
    }
1019605
public function isNumeric($value, $message = '')
    {
        $this->assertion->setActual($value);

        return $this->assertion->to->satisfy('is_numeric', $message);
    }
298673
public function isValid(Message $message)
    {
        try {
            $this->validate($message);
            return true;
        } catch (InvalidSnsMessageException $e) {
            return false;
        }
    }
691344
private function validate_validator( $value, ExtendedValidatorInterface $validator, $key, $message ) {

		$valid = $validator->is_valid( $value );
		if ( $valid ) {
			return TRUE;
		}

		if ( $validator instanceof MultiValidatorInterface ) {
			$data = $validator->get_error_data();
			foreach ( $data as $code => $code_data ) {
				foreach ( $code_data as $error_data ) {
					$this->validator_log_error( $code, $error_data, $key, $message );
				}
			}

			return FALSE;
		}

		$this->validator_log_error( $validator->get_error_code(), $validator->get_input_data(), $key, $message );

		return FALSE;
	}
1256004
protected function validate(array $message)
    {
        $sign = $message['sign'];
        unset($message['sign']);

        if (Support\generate_sign($message, $this->app->getKey()) !== $sign) {
            throw new InvalidSignException();
        }
    }
1015239
public function setMessage($message)
    {
        $messageVariables = null;

        if (is_array($message)) {
            if (array_key_exists('messageVariables', $message)) {
                $messageVariables = $message['messageVariables'];
            }

            if (array_key_exists('message', $message)) {
                $message = $message['message'];
            } else {
                $messageVariables = $message;
                $message          = $this->messageTemplate;
            }
        }

        if (!is_string($message)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Wrong parameters for %s([array|string $message]); %s given.',
                    __METHOD__,
                    is_object($message) ? get_class($message) : gettype($message)
                ),
                E_ERROR
            );
        }

        $this->message = $this->createMessage($message, $messageVariables);

        return $this;
    }
27467
public function validate($input) {
        if (is_integer($input)) {
            return $this->validateMax($input) && $this->validateMin($input);
        }
        return $input == intval($input) && $this->validateMax($input) && $this->validateMin($input);
    }