Files
kiri-core/Annotation/Route/Limits.php
T
2021-02-23 14:54:47 +08:00

46 lines
694 B
PHP

<?php
namespace Annotation\Route;
use Annotation\IAnnotation;
use JetBrains\PhpStorm\Pure;
use ReflectionException;
use Snowflake\Exception\NotFindClassException;
use Snowflake\Snowflake;
/**
* Class Limits
* @package Annotation\Route
*/
#[\Attribute(\Attribute::TARGET_METHOD)] class Limits implements IAnnotation
{
use Node;
/**
* Limits constructor.
* @param string|array $limits
* @throws
*/
#[Pure] public function __construct(public string|array $limits)
{
if (is_string($this->limits)) {
$this->limits = [$this->limits];
}
}
/**
* @param array $handler
* @return Limits
*/
public function execute(array $handler): static
{
return $this;
}
}