eee
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Kiri\Router\Annotate;
|
||||
|
||||
use Kiri\Di\Interface\InjectMethodInterface;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
class Defer implements InjectMethodInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param string|array $callback Class name or [Class::class, 'method']
|
||||
* @param array $params
|
||||
*/
|
||||
public function __construct(readonly public string|array $callback, readonly public array $params = [])
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
*/
|
||||
public function dispatch(string $class, string $method): void
|
||||
{
|
||||
DeferRegistry::add($class, $method, $this);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user