add level for Init

This commit is contained in:
crazywhalecc 2023-01-02 23:14:30 +08:00
parent 316c29628a
commit dbbc6f75d8
No known key found for this signature in database
GPG Key ID: 4B0FFA175E762022

View File

@ -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;
}
}