From ef235690136d5b2f64c541dbb2571a5aa768bf83 Mon Sep 17 00:00:00 2001 From: Simon Asika Date: Tue, 19 Sep 2023 21:23:41 +0800 Subject: [PATCH] misc --- src/WebSocket/Application/WsAppContext.php | 2 +- src/WebSocket/Middleware/WebSocketRoutingMiddleware.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WebSocket/Application/WsAppContext.php b/src/WebSocket/Application/WsAppContext.php index b8164c75..d407d3db 100644 --- a/src/WebSocket/Application/WsAppContext.php +++ b/src/WebSocket/Application/WsAppContext.php @@ -55,7 +55,7 @@ public function pushSelf(mixed ...$args): bool return $this->pushTo($this->getFd(), ...$args); } - public function pushSelfRaw(string $data): bool + public function pushRawSelf(string $data): bool { return $this->pushRawTo($this->getFd(), $data); } diff --git a/src/WebSocket/Middleware/WebSocketRoutingMiddleware.php b/src/WebSocket/Middleware/WebSocketRoutingMiddleware.php index 3717bb87..4502a101 100644 --- a/src/WebSocket/Middleware/WebSocketRoutingMiddleware.php +++ b/src/WebSocket/Middleware/WebSocketRoutingMiddleware.php @@ -43,7 +43,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface throw new \InvalidArgumentException(static::class . ' must use on websocket environment.'); } - $request = $this->handleByClient($request); + $request = $this->handleByParser($request); $route = $request->getRequestTarget(); $matched = $router->match($request, $route); @@ -83,7 +83,7 @@ function (WsAppContext $context) use ($request, $controller, $matched) { ); } - protected function handleByClient(WebSocketRequestInterface $request): WebSocketRequestInterface + protected function handleByParser(WebSocketRequestInterface $request): WebSocketRequestInterface { return $this->app->getParser()->handleRequest($request); }