2023-04-15 23:29:27 +08:00
|
|
|
<?php
|
|
|
|
|
|
2023-04-15 23:31:16 +08:00
|
|
|
namespace Kiri\Router\Inject;
|
2023-04-15 23:29:27 +08:00
|
|
|
|
2023-04-15 23:31:16 +08:00
|
|
|
use Kiri\Di\Interface\InjectPropertyInterface;
|
2023-04-15 23:29:27 +08:00
|
|
|
|
|
|
|
|
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
|
|
|
|
class Middleware implements InjectPropertyInterface
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $middleware
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(readonly public string $middleware)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param object $class
|
|
|
|
|
* @param string $property
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function dispatch(object $class, string $property): void
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|