Skip to content

Commit 820b47a

Browse files
committed
优化注释,尽可能使用 inheritDoc 注释
1 parent 5de27ec commit 820b47a

10 files changed

+22
-39
lines changed

example/Consumer/AConsumer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class AConsumer extends BaseQueueConsumer
1717
{
1818
/**
19-
* 处理消费.
19+
* {@inheritDoc}
2020
*/
2121
protected function consume(IMessage $message, IQueueDriver $queue): void
2222
{

example/Consumer/BConsumer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class BConsumer extends BaseQueueConsumer
1717
{
1818
/**
19-
* 处理消费.
19+
* {@inheritDoc}
2020
*/
2121
protected function consume(IMessage $message, IQueueDriver $queue): void
2222
{

example/Listener/WorkerStartListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class WorkerStartListener implements IEventListener
2525
protected $imiQueue;
2626

2727
/**
28-
* 事件处理方法.
28+
* {@inheritDoc}
2929
*/
3030
public function handle(EventParam $e): void
3131
{

src/Event/Listener/IConsumerAfterConsumeListener.php

-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@
1111
*/
1212
interface IConsumerAfterConsumeListener
1313
{
14-
/**
15-
* 事件处理方法.
16-
*/
1714
public function handle(ConsumerAfterConsumeParam $e): void;
1815
}

src/Event/Listener/IConsumerAfterPopListener.php

-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@
1111
*/
1212
interface IConsumerAfterPopListener
1313
{
14-
/**
15-
* 事件处理方法.
16-
*/
1714
public function handle(ConsumerAfterPopParam $e): void;
1815
}

src/Event/Listener/IConsumerBeforeConsumeListener.php

-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@
1111
*/
1212
interface IConsumerBeforeConsumeListener
1313
{
14-
/**
15-
* 事件处理方法.
16-
*/
1714
public function handle(ConsumerBeforeConsumeParam $e): void;
1815
}

src/Event/Listener/IConsumerBeforePopListener.php

-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@
1111
*/
1212
interface IConsumerBeforePopListener
1313
{
14-
/**
15-
* 事件处理方法.
16-
*/
1714
public function handle(ConsumerBeforePopParam $e): void;
1815
}

src/Model/Message.php

+15-21
Original file line numberDiff line numberDiff line change
@@ -37,93 +37,87 @@ class Message implements IMessage
3737
protected float $workingTimeout = 0;
3838

3939
/**
40-
* 获取消息 ID.
40+
* {@inheritDoc}
4141
*/
4242
public function getMessageId(): string
4343
{
4444
return $this->messageId;
4545
}
4646

4747
/**
48-
* 设置消息 ID.
48+
* {@inheritDoc}
4949
*/
5050
public function setMessageId(string $messageId): void
5151
{
5252
$this->messageId = $messageId;
5353
}
5454

5555
/**
56-
* 获取消息内容.
56+
* {@inheritDoc}
5757
*/
5858
public function getMessage(): string
5959
{
6060
return $this->message;
6161
}
6262

6363
/**
64-
* 设置消息内容.
64+
* {@inheritDoc}
6565
*/
6666
public function setMessage(string $message): void
6767
{
6868
$this->message = $message;
6969
}
7070

7171
/**
72-
* 获取工作超时时间,单位:秒.
72+
* {@inheritDoc}
7373
*/
7474
public function getWorkingTimeout(): float
7575
{
7676
return $this->workingTimeout;
7777
}
7878

7979
/**
80-
* 设置工作超时时间,单位:秒.
81-
*
82-
* @param float $workingTimeout
80+
* {@inheritDoc}
8381
*/
84-
public function setWorkingTimeout($workingTimeout): void
82+
public function setWorkingTimeout(float $workingTimeout): void
8583
{
8684
$this->workingTimeout = (float) $workingTimeout;
8785
}
8886

8987
/**
90-
* 获取已重试次数.
88+
* {@inheritDoc}
9189
*/
9290
public function getRetryCount(): int
9391
{
9492
return $this->retryCount;
9593
}
9694

9795
/**
98-
* 获取重试次数.
99-
*
100-
* @param int $retryCount
96+
* {@inheritDoc}
10197
*/
102-
public function setRetryCount($retryCount): void
98+
public function setRetryCount(int $retryCount): void
10399
{
104100
$this->retryCount = (int) $retryCount;
105101
}
106102

107103
/**
108-
* 获取最大重试次数.
104+
* {@inheritDoc}
109105
*/
110106
public function getMaxRetryCount(): int
111107
{
112108
return $this->maxRetryCount;
113109
}
114110

115111
/**
116-
* 获取最大重试次数.
117-
*
118-
* @param int $maxRetryCount
112+
* {@inheritDoc}
119113
*/
120-
public function setMaxRetryCount($maxRetryCount): void
114+
public function setMaxRetryCount(int $maxRetryCount): void
121115
{
122116
$this->maxRetryCount = (int) $maxRetryCount;
123117
}
124118

125119
/**
126-
* 将当前对象作为数组返回.
120+
* {@inheritDoc}
127121
*/
128122
public function toArray(): array
129123
{
@@ -137,7 +131,7 @@ public function toArray(): array
137131
}
138132

139133
/**
140-
* 从数组加载数据.
134+
* {@inheritDoc}
141135
*/
142136
public function loadFromArray(array $data): void
143137
{

src/Model/QueueStatus.php

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public function getDelay(): int
7979
return $this->delay;
8080
}
8181

82+
/**
83+
* {@inheritDoc}
84+
*/
8285
public function jsonSerialize()
8386
{
8487
$data = [];

src/Partial/SwooleBaseQueueConsumerPartial.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ public function start(?int $co = null): void
8383
// @phpstan-ignore-next-line
8484
$this->coPool = $pool = new CoPool($co, $co, new class() implements ICoTask {
8585
/**
86-
* 执行任务
87-
*
88-
* @return mixed
86+
* {@inheritDoc}
8987
*/
9088
public function run(ITaskParam $param)
9189
{

0 commit comments

Comments
 (0)