2020-03-25 18:35:16 +08:00
|
|
|
<?php
|
|
|
|
|
|
2022-03-15 18:05:33 +08:00
|
|
|
declare(strict_types=1);
|
2020-03-25 18:35:16 +08:00
|
|
|
|
|
|
|
|
namespace ZM\Annotation\Http;
|
|
|
|
|
|
2022-03-20 01:53:36 +08:00
|
|
|
use Attribute;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
2020-03-25 18:35:16 +08:00
|
|
|
use Doctrine\Common\Annotations\Annotation\Required;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\Target;
|
|
|
|
|
use ZM\Annotation\AnnotationBase;
|
2020-08-31 10:11:06 +08:00
|
|
|
use ZM\Annotation\Interfaces\ErgodicAnnotation;
|
2020-03-25 18:35:16 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class Middleware
|
|
|
|
|
* @Annotation
|
2022-03-20 01:53:36 +08:00
|
|
|
* @NamedArgumentConstructor()
|
2020-04-26 15:56:06 +08:00
|
|
|
* @Target("ALL")
|
2020-03-25 18:35:16 +08:00
|
|
|
*/
|
2022-03-20 01:53:36 +08:00
|
|
|
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_ALL)]
|
2020-08-31 10:11:06 +08:00
|
|
|
class Middleware extends AnnotationBase implements ErgodicAnnotation
|
2020-03-25 18:35:16 +08:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
* @Required()
|
|
|
|
|
*/
|
|
|
|
|
public $middleware;
|
2021-07-04 15:45:30 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var string[]
|
|
|
|
|
*/
|
|
|
|
|
public $params = [];
|
2022-03-20 01:53:36 +08:00
|
|
|
|
|
|
|
|
public function __construct($middleware, $params = [])
|
|
|
|
|
{
|
|
|
|
|
$this->middleware = $middleware;
|
|
|
|
|
$this->params = $params;
|
|
|
|
|
}
|
2020-04-26 15:56:06 +08:00
|
|
|
}
|