Skip to content

Commit

Permalink
优化注释,尽可能使用 inheritDoc 注释
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Oct 13, 2021
1 parent 9fdb6ed commit d13e5f9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions example/GrpcServer/Middleware/PoweredBy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion example/Listener/OnServerCreateAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class OnServerCreateAfter implements IEventListener
{
/**
* 事件处理方法.
* {@inheritDoc}
*/
public function handle(EventParam $e): void
{
Expand Down
8 changes: 2 additions & 6 deletions example/Task/TestTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/grpc/Listener/WorkerExit.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class WorkerExit implements IEventListener
{
/**
* 事件处理方法.
* {@inheritDoc}
*/
public function handle(EventParam $e): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/grpc/Middleware/ActionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ActionMiddleware implements MiddlewareInterface
private array $actionMethodParams = [];

/**
* 处理方法.
* {@inheritDoc}
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
Expand Down
1 change: 1 addition & 0 deletions src/server/Error/DefaultGrpcErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/server/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Server extends \Imi\Swoole\Server\Http\Server
{
/**
* 创建 swoole 服务器对象
* {@inheritDoc}
*/
protected function createServer(): void
{
Expand All @@ -24,7 +24,7 @@ protected function createServer(): void
}

/**
* 从主服务器监听端口,作为子服务器.
* {@inheritDoc}
*/
protected function createSubServer(): void
{
Expand Down

0 comments on commit d13e5f9

Please sign in to comment.