Skip to content

Commit 4b06bef

Browse files
committed
Re-introduce @return in dockblocks
1 parent 75373f1 commit 4b06bef

32 files changed

+95
-2
lines changed

rector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
55
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
66
use Rector\Config\RectorConfig;
7+
use Rector\DeadCode\Rector\ClassMethod\RemoveNullTagValueNodeRector;
8+
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
79
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
810
use Rector\ValueObject\PhpVersion;
911

@@ -17,10 +19,13 @@
1719
DisallowedEmptyRuleFixerRector::class,
1820
SimplifyIfElseToTernaryRector::class,
1921
MakeInheritedMethodVisibilitySameAsParentRector::class,
22+
RemoveNullTagValueNodeRector::class,
23+
RemoveUselessReturnTagRector::class,
2024
])
2125
->withParallel()
2226
->withPreparedSets(
2327
deadCode: true,
2428
codeQuality: true,
2529
codingStyle: true,
30+
typeDeclarationDocblocks: true,
2631
);

src/Command/JobCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function templateData(Arguments $arguments): array
6969
* Gets the option parser instance and configures it.
7070
*
7171
* @param \Cake\Console\ConsoleOptionParser $parser The parser to update.
72+
* @return \Cake\Console\ConsoleOptionParser
7273
*/
7374
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
7475
{

src/Command/PurgeFailedCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class PurgeFailedCommand extends Command
2828

2929
/**
3030
* Get the command name.
31+
*
32+
* @return string
3133
*/
3234
public static function defaultName(): string
3335
{
@@ -36,6 +38,8 @@ public static function defaultName(): string
3638

3739
/**
3840
* Gets the option parser instance and configures it.
41+
*
42+
* @return \Cake\Console\ConsoleOptionParser
3943
*/
4044
public function getOptionParser(): ConsoleOptionParser
4145
{
@@ -68,6 +72,7 @@ public function getOptionParser(): ConsoleOptionParser
6872
/**
6973
* @param \Cake\Console\Arguments $args Arguments
7074
* @param \Cake\Console\ConsoleIo $io ConsoleIo
75+
* @return int
7176
*/
7277
public function execute(Arguments $args, ConsoleIo $io): int
7378
{

src/Command/RequeueCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class RequeueCommand extends Command
3030

3131
/**
3232
* Get the command name.
33+
*
34+
* @return string
3335
*/
3436
public static function defaultName(): string
3537
{
@@ -38,6 +40,8 @@ public static function defaultName(): string
3840

3941
/**
4042
* Gets the option parser instance and configures it.
43+
*
44+
* @return \Cake\Console\ConsoleOptionParser
4145
*/
4246
public function getOptionParser(): ConsoleOptionParser
4347
{
@@ -70,6 +74,7 @@ public function getOptionParser(): ConsoleOptionParser
7074
/**
7175
* @param \Cake\Console\Arguments $args Arguments
7276
* @param \Cake\Console\ConsoleIo $io ConsoleIo
77+
* @return int
7378
*/
7479
public function execute(Arguments $args, ConsoleIo $io): int
7580
{

src/Command/WorkerCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function __construct(
5353

5454
/**
5555
* Get the command name.
56+
*
57+
* @return string
5658
*/
5759
public static function defaultName(): string
5860
{
@@ -61,6 +63,8 @@ public static function defaultName(): string
6163

6264
/**
6365
* Gets the option parser instance and configures it.
66+
*
67+
* @return \Cake\Console\ConsoleOptionParser
6468
*/
6569
public function getOptionParser(): ConsoleOptionParser
6670
{
@@ -113,6 +117,7 @@ public function getOptionParser(): ConsoleOptionParser
113117
*
114118
* @param \Cake\Console\Arguments $args Arguments
115119
* @param \Psr\Log\LoggerInterface $logger Logger instance.
120+
* @return \Enqueue\Consumption\ExtensionInterface
116121
*/
117122
protected function getQueueExtension(Arguments $args, LoggerInterface $logger): ExtensionInterface
118123
{
@@ -149,6 +154,7 @@ protected function getQueueExtension(Arguments $args, LoggerInterface $logger):
149154
* Creates and returns a LoggerInterface object
150155
*
151156
* @param \Cake\Console\Arguments $args Arguments
157+
* @return \Psr\Log\LoggerInterface
152158
*/
153159
protected function getLogger(Arguments $args): LoggerInterface
154160
{
@@ -166,6 +172,7 @@ protected function getLogger(Arguments $args): LoggerInterface
166172
* @param \Cake\Console\Arguments $args Arguments
167173
* @param \Cake\Console\ConsoleIo $io ConsoleIo
168174
* @param \Psr\Log\LoggerInterface $logger Logger instance
175+
* @return \Interop\Queue\Processor
169176
*/
170177
protected function getProcessor(Arguments $args, ConsoleIo $io, LoggerInterface $logger): InteropProcessor
171178
{
@@ -190,6 +197,7 @@ protected function getProcessor(Arguments $args, ConsoleIo $io, LoggerInterface
190197
/**
191198
* @param \Cake\Console\Arguments $args Arguments
192199
* @param \Cake\Console\ConsoleIo $io ConsoleIo
200+
* @return int
193201
*/
194202
public function execute(Arguments $args, ConsoleIo $io): int
195203
{

src/Consumption/LimitAttemptsExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class LimitAttemptsExtension implements MessageResultExtensionInterface
2626

2727
/**
2828
* @param int|null $maxAttempts The maximum number of times a job may be attempted. $maxAttempts defined on a Job will override this value.
29+
* @return void
2930
*/
3031
public function __construct(
3132
protected readonly ?int $maxAttempts = null,
@@ -34,6 +35,7 @@ public function __construct(
3435

3536
/**
3637
* @param \Enqueue\Consumption\Context\MessageResult $context The result of the message after it was processed.
38+
* @return void
3739
*/
3840
public function onResult(MessageResult $context): void
3941
{

src/Consumption/LimitConsumedMessagesExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class LimitConsumedMessagesExtension implements PreConsumeExtensionInterface, Po
2222

2323
/**
2424
* @param int $messageLimit The number of messages to process before exiting.
25+
* @return void
2526
*/
2627
public function __construct(
2728
protected readonly int $messageLimit,
@@ -33,6 +34,7 @@ public function __construct(
3334
* The consumption could be interrupted at this step.
3435
*
3536
* @param \Enqueue\Consumption\Context\PreConsume $context The PreConsume context.
37+
* @return void
3638
*/
3739
public function onPreConsume(PreConsume $context): void
3840
{
@@ -47,6 +49,7 @@ public function onPreConsume(PreConsume $context): void
4749
* The consumption could be interrupted at this point.
4850
*
4951
* @param \Enqueue\Consumption\Context\PostConsume $context The PostConsume context.
52+
* @return void
5053
*/
5154
public function onPostConsume(PostConsume $context): void
5255
{
@@ -61,6 +64,7 @@ public function onPostConsume(PostConsume $context): void
6164
* Check if the consumer should be stopped.
6265
*
6366
* @param \Psr\Log\LoggerInterface $logger The logger where messages will be logged.
67+
* @return bool
6468
*/
6569
protected function shouldBeStopped(LoggerInterface $logger): bool
6670
{

src/Consumption/RemoveUniqueJobIdFromCacheExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class RemoveUniqueJobIdFromCacheExtension implements MessageResultExtensionInter
1313
{
1414
/**
1515
* @param string $cache Cache engine name.
16+
* @return void
1617
*/
1718
public function __construct(
1819
protected readonly string $cache,
@@ -21,6 +22,7 @@ public function __construct(
2122

2223
/**
2324
* @param \Enqueue\Consumption\Context\MessageResult $context The result of the message after it was processed.
25+
* @return void
2426
*/
2527
public function onResult(MessageResult $context): void
2628
{

src/Job/JobInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface JobInterface
2222
* Executes logic for Job
2323
*
2424
* @param \Cake\Queue\Job\Message $message job message
25+
* @return string|null
2526
*/
2627
public function execute(Message $message): ?string;
2728
}

src/Job/MailerJob.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class MailerJob implements JobInterface
2929
* Constructs and dispatches the event from a job message
3030
*
3131
* @param \Cake\Queue\Job\Message $message job message
32+
* @return string|null
3233
*/
3334
public function execute(Message $message): ?string
3435
{

0 commit comments

Comments
 (0)