This commit is contained in:
as2252258@163.com
2021-03-29 03:19:22 +08:00
parent 62ea2c7d7d
commit 796b819fe5
2 changed files with 75 additions and 62 deletions
+1 -3
View File
@@ -54,9 +54,7 @@ class Dispatch
*/ */
public function dispatch(): mixed public function dispatch(): mixed
{ {
/** @var Aop $aop */ return \aop($this->handler, $this->request);
$aop = Snowflake::app()->get('aop');
return call_user_func([$aop, 'dispatch'], $this->handler, ...$this->request);
} }
+15
View File
@@ -298,6 +298,21 @@ if (!function_exists('fire')) {
} }
} }
if (!function_exists('aop')) {
/**
* @param string $event
* @param array $params
* @throws Exception
* @throws Exception
*/
function aop(mixed $handler, array $params = [])
{
return Snowflake::app()->get('aop')->dispatch($handler, ...$params);
}
}
if (!function_exists('objectPool')) { if (!function_exists('objectPool')) {