This commit is contained in:
2021-07-21 11:25:31 +08:00
parent 3b05c856ef
commit 8f6079b040
9 changed files with 201 additions and 112 deletions
+2 -2
View File
@@ -87,7 +87,7 @@ class Event extends BaseObject
* @param bool $isAppend
* @throws Exception
*/
public static function on($name, $callback, $parameter = [], $isAppend = false)
public static function on($name, $callback, array $parameter = [], bool $isAppend = false)
{
if (!isset(static::$_events[$name])) {
static::$_events[$name] = [];
@@ -204,7 +204,7 @@ class Event extends BaseObject
* @return bool
* @throws Exception
*/
public function dispatch($name, $params = [], $scope = null): bool
public function dispatch($name, array $params = [], $scope = null): bool
{
return static::trigger($name, $params, $scope);
}