This commit is contained in:
as2252258@163.com
2021-05-03 03:48:52 +08:00
parent a90e647529
commit 8137b24865
25 changed files with 273 additions and 306 deletions
+2 -2
View File
@@ -44,14 +44,14 @@ use Snowflake\Snowflake;
* @return Router
* @throws Exception
*/
public function execute(array $handler): Router
public function execute(mixed $class, mixed $method = null): Router
{
// TODO: Implement setHandler() method.
$router = Snowflake::app()->getRouter();
$method = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri);
$router->addRoute($method, $handler, 'sw::socket');
$router->addRoute($method, [$class, $method], 'sw::socket');
return $router;
}