respect-validation/library/Rules/ResourceType.php

29 lines
486 B
PHP
Raw Normal View History

2015-08-20 05:55:32 +02:00
<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
2015-08-20 05:55:32 +02:00
*/
declare(strict_types=1);
2015-08-20 05:55:32 +02:00
namespace Respect\Validation\Rules;
use function is_resource;
2015-08-20 05:55:32 +02:00
/**
* Validates whether the input is a resource.
*
2015-08-20 05:55:32 +02:00
* @author Henrique Moody <henriquemoody@gmail.com>
*/
final class ResourceType extends AbstractRule
2015-08-20 05:55:32 +02:00
{
/**
* {@inheritDoc}
2015-08-20 05:55:32 +02:00
*/
public function validate($input): bool
2015-08-20 05:55:32 +02:00
{
return is_resource($input);
}
}