add middleware arg trait and annotation trait

This commit is contained in:
crazywhalecc
2023-03-05 22:15:01 +08:00
committed by Jerry
parent b8501e94f0
commit 3e2911b807
7 changed files with 129 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace ZM\Middleware;
use ZM\Annotation\AnnotationBase;
trait NeedAnnotationTrait
{
protected ?AnnotationBase $annotation = null;
public function setAnnotation(AnnotationBase $annotation): void
{
$this->annotation = $annotation;
}
public function getAnnotation(): ?AnnotationBase
{
return $this->annotation;
}
}