mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-14 04:05:35 +08:00
update to 2.1.0 version
add @OnCloseEvent, @OnOpenEvent, @OnMessageEvent, @OnRequestEvent update EventDispatcher.php and change it to status-based schema fix @CQBefore bugs
This commit is contained in:
49
src/ZM/Annotation/Swoole/OnSwooleEventBase.php
Normal file
49
src/ZM/Annotation/Swoole/OnSwooleEventBase.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user