From d13e5f9fa38629a28bd7adcadc0cef9dcb2e14cd Mon Sep 17 00:00:00 2001 From: Yurun Date: Wed, 13 Oct 2021 13:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B3=A8=E9=87=8A=EF=BC=8C?= =?UTF-8?q?=E5=B0=BD=E5=8F=AF=E8=83=BD=E4=BD=BF=E7=94=A8=20inheritDoc=20?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/GrpcServer/Middleware/PoweredBy.php | 3 +-- example/Listener/OnServerCreateAfter.php | 2 +- example/Task/TestTask.php | 8 ++------ src/grpc/Listener/WorkerExit.php | 2 +- src/grpc/Middleware/ActionMiddleware.php | 2 +- src/server/Error/DefaultGrpcErrorHandler.php | 1 + src/server/Server.php | 4 ++-- 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/example/GrpcServer/Middleware/PoweredBy.php b/example/GrpcServer/Middleware/PoweredBy.php index 62baa39..6bfcc8c 100644 --- a/example/GrpcServer/Middleware/PoweredBy.php +++ b/example/GrpcServer/Middleware/PoweredBy.php @@ -15,8 +15,7 @@ class PoweredBy implements MiddlewareInterface { /** - * Process an incoming server request and return a response, optionally delegating - * response creation to a handler. + * {@inheritDoc} */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { diff --git a/example/Listener/OnServerCreateAfter.php b/example/Listener/OnServerCreateAfter.php index 35b3577..0c0bbad 100644 --- a/example/Listener/OnServerCreateAfter.php +++ b/example/Listener/OnServerCreateAfter.php @@ -15,7 +15,7 @@ class OnServerCreateAfter implements IEventListener { /** - * 事件处理方法. + * {@inheritDoc} */ public function handle(EventParam $e): void { diff --git a/example/Task/TestTask.php b/example/Task/TestTask.php index fb34893..291a4b1 100644 --- a/example/Task/TestTask.php +++ b/example/Task/TestTask.php @@ -14,9 +14,7 @@ class TestTask implements ITaskHandler { /** - * 任务处理方法,返回的值会通过 finish 事件推送给 worker 进程. - * - * @return mixed + * {@inheritDoc} */ public function handle(TaskParam $param, \Swoole\Server $server, int $taskId, int $workerId) { @@ -26,9 +24,7 @@ public function handle(TaskParam $param, \Swoole\Server $server, int $taskId, in } /** - * 任务结束时触发. - * - * @param mixed $data + * {@inheritDoc} */ public function finish(\Swoole\Server $server, int $taskId, $data): void { diff --git a/src/grpc/Listener/WorkerExit.php b/src/grpc/Listener/WorkerExit.php index df714ae..f29a651 100644 --- a/src/grpc/Listener/WorkerExit.php +++ b/src/grpc/Listener/WorkerExit.php @@ -20,7 +20,7 @@ class WorkerExit implements IEventListener { /** - * 事件处理方法. + * {@inheritDoc} */ public function handle(EventParam $e): void { diff --git a/src/grpc/Middleware/ActionMiddleware.php b/src/grpc/Middleware/ActionMiddleware.php index f53df50..b3c9dd5 100644 --- a/src/grpc/Middleware/ActionMiddleware.php +++ b/src/grpc/Middleware/ActionMiddleware.php @@ -39,7 +39,7 @@ class ActionMiddleware implements MiddlewareInterface private array $actionMethodParams = []; /** - * 处理方法. + * {@inheritDoc} */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { diff --git a/src/server/Error/DefaultGrpcErrorHandler.php b/src/server/Error/DefaultGrpcErrorHandler.php index 5e3cd05..2438a8a 100644 --- a/src/server/Error/DefaultGrpcErrorHandler.php +++ b/src/server/Error/DefaultGrpcErrorHandler.php @@ -29,6 +29,7 @@ public function handle(\Throwable $throwable): bool { $response = $response->withTrailer('grpc-message', $this->getGrpcMessage($throwable)); } + /** @var \Imi\Server\Http\Message\Response $response */ $response->send(); return false; diff --git a/src/server/Server.php b/src/server/Server.php index 9f187dc..88b92bc 100644 --- a/src/server/Server.php +++ b/src/server/Server.php @@ -14,7 +14,7 @@ class Server extends \Imi\Swoole\Server\Http\Server { /** - * 创建 swoole 服务器对象 + * {@inheritDoc} */ protected function createServer(): void { @@ -24,7 +24,7 @@ protected function createServer(): void } /** - * 从主服务器监听端口,作为子服务器. + * {@inheritDoc} */ protected function createSubServer(): void {