Files
kiri-core/Annotation/Route/After.php
T
2020-12-16 15:20:51 +08:00

33 lines
549 B
PHP

<?php
namespace Annotation\Route;
use Snowflake\Snowflake;
/**
* Class Interceptor
* @package Annotation\Route
*/
#[\Attribute(\Attribute::TARGET_METHOD)] class After
{
/**
* Interceptor constructor.
* @param \HttpServer\IInterface\After|\HttpServer\IInterface\After[] $after
* @throws
*/
public function __construct(public string|array $after)
{
if (is_string($this->after)) {
$this->after = [$this->after];
}
foreach ($this->after as $key => $item) {
$this->after[$key] = Snowflake::createObject($item);
}
}
}