From dbbc6f75d8edb31a18edbc8997fdf215c758a47c Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Mon, 2 Jan 2023 23:14:30 +0800 Subject: [PATCH] add level for Init --- src/ZM/Annotation/Framework/Init.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ZM/Annotation/Framework/Init.php b/src/ZM/Annotation/Framework/Init.php index edda9562..ad4c8296 100644 --- a/src/ZM/Annotation/Framework/Init.php +++ b/src/ZM/Annotation/Framework/Init.php @@ -8,6 +8,7 @@ use Attribute; use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; use Doctrine\Common\Annotations\Annotation\Target; use ZM\Annotation\AnnotationBase; +use ZM\Annotation\Interfaces\Level; /** * Class Init @@ -17,9 +18,19 @@ use ZM\Annotation\AnnotationBase; * @since 3.0.0 */ #[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)] -class Init extends AnnotationBase +class Init extends AnnotationBase implements Level { - public function __construct(public int $worker = 0) + public function __construct(public int $worker = 0, public int $level = 20) { } + + public function getLevel() + { + return $this->level; + } + + public function setLevel($level) + { + $this->level = $level; + } }