Files
kiri-router/src/Validator/Inject/Required.php
T
2023-04-16 01:24:30 +08:00

25 lines
431 B
PHP

<?php
declare(strict_types=1);
namespace Kiri\Router\Validator\Inject;
use Kiri\Router\Interface\ValidatorInterface;
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class Required implements ValidatorInterface
{
/**
* @param object $class
* @param string $name
* @return bool
*/
public function dispatch(object $class, string $name): bool
{
// TODO: Implement dispatch() method.
return $class->$name === null;
}
}