Files
kiri-router/src/Validator/Inject/Required.php
T

25 lines
431 B
PHP
Raw Normal View History

2023-04-15 23:29:27 +08:00
<?php
2023-04-16 01:24:30 +08:00
declare(strict_types=1);
2023-04-15 23:29:27 +08:00
2023-04-15 23:31:16 +08:00
namespace Kiri\Router\Validator\Inject;
2023-04-15 23:29:27 +08:00
2023-04-15 23:31:16 +08:00
use Kiri\Router\Interface\ValidatorInterface;
2023-04-15 23:29:27 +08:00
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class Required implements ValidatorInterface
{
2023-04-15 23:31:16 +08:00
/**
* @param object $class
* @param string $name
* @return bool
*/
public function dispatch(object $class, string $name): bool
2023-04-15 23:29:27 +08:00
{
// TODO: Implement dispatch() method.
2023-04-15 23:31:16 +08:00
return $class->$name === null;
2023-04-15 23:29:27 +08:00
}
}