mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-22 16:15:34 +08:00
add middleware arg trait and annotation trait
This commit is contained in:
22
src/ZM/Middleware/NeedAnnotationTrait.php
Normal file
22
src/ZM/Middleware/NeedAnnotationTrait.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user