This commit is contained in:
2021-02-22 18:07:40 +08:00
parent e4670ecc3f
commit cfc2d98076
2 changed files with 22 additions and 18 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ class Command extends \Console\Command
return 'shutdown success.';
}
listen(Event::SERVER_BEFORE_START, [$this, 'scan_system_annotation']);
$this->scan_system_annotation();
return $manager->start();
}
+6 -2
View File
@@ -187,10 +187,11 @@ class Event extends BaseObject
* @param null $parameter
* @param null $handler
* @param false $is_remove
* @return mixed
* @return bool
*/
public function trigger($name, $parameter = null, $handler = null, $is_remove = false): mixed
public function trigger($name, $parameter = null, $handler = null, $is_remove = false): bool
{
try {
if (!$this->exists($name)) {
return false;
}
@@ -209,6 +210,9 @@ class Event extends BaseObject
$this->offName($name);
}
return true;
} catch (\Throwable $throwable) {
return false;
}
}