From d3f4ade215f490ccc11e57ac8aa521ea1cf24add Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 25 Mar 2022 19:15:58 +0800 Subject: [PATCH] Add Attribute and property (build 453, release 2.7.3) --- src/ZM/Annotation/Swoole/OnTick.php | 2 ++ src/ZM/Annotation/Swoole/SwooleHandler.php | 2 ++ src/ZM/ConsoleApplication.php | 2 +- src/ZM/Http/MiddlewareInterface.php | 5 +++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ZM/Annotation/Swoole/OnTick.php b/src/ZM/Annotation/Swoole/OnTick.php index 26965dca..dc56bd61 100644 --- a/src/ZM/Annotation/Swoole/OnTick.php +++ b/src/ZM/Annotation/Swoole/OnTick.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ZM\Annotation\Swoole; +use Attribute; use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; use Doctrine\Common\Annotations\Annotation\Required; use Doctrine\Common\Annotations\Annotation\Target; @@ -16,6 +17,7 @@ use ZM\Annotation\AnnotationBase; * @Target("METHOD") * @since 1.2 */ +#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] class OnTick extends AnnotationBase { /** diff --git a/src/ZM/Annotation/Swoole/SwooleHandler.php b/src/ZM/Annotation/Swoole/SwooleHandler.php index 4e5c6bc5..5a130094 100644 --- a/src/ZM/Annotation/Swoole/SwooleHandler.php +++ b/src/ZM/Annotation/Swoole/SwooleHandler.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ZM\Annotation\Swoole; +use Attribute; use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; use Doctrine\Common\Annotations\Annotation\Required; use Doctrine\Common\Annotations\Annotation\Target; @@ -15,6 +16,7 @@ use ZM\Annotation\AnnotationBase; * @NamedArgumentConstructor() * @Target("ALL") */ +#[Attribute(Attribute::TARGET_ALL)] class SwooleHandler extends AnnotationBase { /** diff --git a/src/ZM/ConsoleApplication.php b/src/ZM/ConsoleApplication.php index 42aa8fe7..4bd41330 100644 --- a/src/ZM/ConsoleApplication.php +++ b/src/ZM/ConsoleApplication.php @@ -28,7 +28,7 @@ use ZM\Exception\InitException; class ConsoleApplication extends Application { - public const VERSION_ID = 452; + public const VERSION_ID = 453; public const VERSION = '2.7.3'; diff --git a/src/ZM/Http/MiddlewareInterface.php b/src/ZM/Http/MiddlewareInterface.php index 65d01ab0..8d2e3313 100644 --- a/src/ZM/Http/MiddlewareInterface.php +++ b/src/ZM/Http/MiddlewareInterface.php @@ -4,6 +4,11 @@ declare(strict_types=1); namespace ZM\Http; +use ZM\Annotation\Http\Middleware; + +/** + * @property Middleware $middleware + */ interface MiddlewareInterface { }