respect-validation/library/Rules/IntType.php

29 lines
480 B
PHP
Raw Normal View History

2015-10-17 04:43:01 +02:00
<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
2015-10-17 04:43:01 +02:00
*/
declare(strict_types=1);
2015-10-17 04:43:01 +02:00
namespace Respect\Validation\Rules;
use function is_int;
/**
* Validates whether the type of the input is integer.
*
* @author Henrique Moody <henriquemoody@gmail.com>
*/
final class IntType extends AbstractRule
2015-10-17 04:43:01 +02:00
{
/**
* {@inheritDoc}
*/
public function validate($input): bool
2015-10-17 04:43:01 +02:00
{
return is_int($input);
}
}