Files
kiri-validator/EnumValidator.php
T

25 lines
351 B
PHP
Raw Permalink Normal View History

2022-01-09 14:01:11 +08:00
<?php
declare(strict_types=1);
namespace validator;
/**
* Class EnumValidator
* @package validator
*/
class EnumValidator extends BaseValidator
{
2023-05-09 10:11:21 +08:00
/**
2023-12-18 15:01:09 +08:00
* @param mixed $value
2023-05-09 10:11:21 +08:00
* @return bool
*/
2023-12-19 14:51:13 +08:00
public function trigger(mixed $value): bool
2023-07-07 17:24:03 +08:00
{
2023-12-18 15:01:09 +08:00
return in_array($value, $this->value);
2023-07-07 17:24:03 +08:00
}
2022-01-09 14:01:11 +08:00
}