PHP80 小修 (#187)

* migrate-php80

fix styles
fix static analyse

* fix some bugs
This commit is contained in:
sunxyw
2022-12-19 20:22:47 +08:00
committed by GitHub
parent da516b487d
commit 8ff7da4d23
46 changed files with 180 additions and 366 deletions

View File

@@ -23,20 +23,16 @@ use ZM\Annotation\Interfaces\Level;
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)]
class BindEvent extends AnnotationBase implements Level
{
/**
* @Required()
*/
public string $event_class;
public int $level = 800;
/**
* @param string $event_class 绑定事件的类型
*/
public function __construct(string $event_class, int $level = 800)
{
$this->event_class = $event_class;
$this->level = $level;
public function __construct(
/**
* @Required()
*/
public string $event_class,
public int $level = 800
) {
}
public function getLevel(): int

View File

@@ -19,10 +19,7 @@ use ZM\Annotation\AnnotationBase;
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)]
class Init extends AnnotationBase
{
public int $worker = 0;
public function __construct(int $worker = 0)
public function __construct(public int $worker = 0)
{
$this->worker = $worker;
}
}