Files
kiri-core/Annotation/Route/After.php
T

33 lines
549 B
PHP
Raw Normal View History

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