mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-08 01:05:37 +08:00
add @OnCloseEvent, @OnOpenEvent, @OnMessageEvent, @OnRequestEvent update EventDispatcher.php and change it to status-based schema fix @CQBefore bugs
49 lines
839 B
PHP
49 lines
839 B
PHP
<?php
|
|
|
|
|
|
namespace ZM\Annotation\Swoole;
|
|
|
|
|
|
use ZM\Annotation\AnnotationBase;
|
|
use ZM\Annotation\Interfaces\Level;
|
|
use ZM\Annotation\Interfaces\Rule;
|
|
|
|
abstract class OnSwooleEventBase extends AnnotationBase implements Level, Rule
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
public $rule = "";
|
|
/**
|
|
* @var int
|
|
*/
|
|
public $level = 20;
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getRule(): string {
|
|
return $this->rule !== "" ? $this->rule : true;
|
|
}
|
|
|
|
/**
|
|
* @param string $rule
|
|
*/
|
|
public function setRule(string $rule) {
|
|
$this->rule = $rule;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getLevel(): int {
|
|
return $this->level;
|
|
}
|
|
|
|
/**
|
|
* @param int $level
|
|
*/
|
|
public function setLevel(int $level) {
|
|
$this->level = $level;
|
|
}
|
|
} |