Files
zhamao-framework/src/ZM/Annotation/Framework/BindEvent.php
sunxyw 8ff7da4d23 PHP80 小修 (#187)
* migrate-php80

fix styles
fix static analyse

* fix some bugs
2022-12-19 20:22:47 +08:00

48 lines
1015 B
PHP

<?php
declare(strict_types=1);
namespace ZM\Annotation\Framework;
use Attribute;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
use Doctrine\Common\Annotations\Annotation\Required;
use Doctrine\Common\Annotations\Annotation\Target;
use ZM\Annotation\AnnotationBase;
use ZM\Annotation\Interfaces\Level;
/**
* Class BindEvent
* 通过注解绑定 EventProvider 支持的事件
*
* @Annotation
* @NamedArgumentConstructor()
* @Target("METHOD")
* @since 3.0.0
*/
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)]
class BindEvent extends AnnotationBase implements Level
{
/**
* @param string $event_class 绑定事件的类型
*/
public function __construct(
/**
* @Required()
*/
public string $event_class,
public int $level = 800
) {
}
public function getLevel(): int
{
return $this->level;
}
public function setLevel($level)
{
$this->level = $level;
}
}