respect-validation/library/Rules/BoolType.php

34 lines
671 B
PHP
Raw Normal View History

2011-09-13 17:19:04 +02:00
<?php
2015-06-08 16:47:14 +02:00
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/
declare(strict_types=1);
2011-09-13 17:19:04 +02:00
namespace Respect\Validation\Rules;
use function is_bool;
/**
* Validates whether the type of the input is boolean.
*
* @author Devin Torres <devin@devintorres.com>
* @author Henrique Moody <henriquemoody@gmail.com>
*/
final class BoolType extends AbstractRule
2011-09-13 17:19:04 +02:00
{
/**
* {@inheritDoc}
*/
public function validate($input): bool
2011-09-13 17:19:04 +02:00
{
return is_bool($input);
}
}