mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-12 11:15:34 +08:00
add PHP8 Attribute compatibility (build 439, 2.7.0-beta4)
This commit is contained in:
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZM\Annotation\Http;
|
||||
|
||||
use Attribute;
|
||||
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
||||
use Doctrine\Common\Annotations\Annotation\Required;
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use ZM\Annotation\AnnotationBase;
|
||||
@@ -12,8 +14,10 @@ use ZM\Annotation\Interfaces\ErgodicAnnotation;
|
||||
/**
|
||||
* Class Middleware
|
||||
* @Annotation
|
||||
* @NamedArgumentConstructor()
|
||||
* @Target("ALL")
|
||||
*/
|
||||
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_ALL)]
|
||||
class Middleware extends AnnotationBase implements ErgodicAnnotation
|
||||
{
|
||||
/**
|
||||
@@ -26,4 +30,10 @@ class Middleware extends AnnotationBase implements ErgodicAnnotation
|
||||
* @var string[]
|
||||
*/
|
||||
public $params = [];
|
||||
|
||||
public function __construct($middleware, $params = [])
|
||||
{
|
||||
$this->middleware = $middleware;
|
||||
$this->params = $params;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user