Skip to content

Commit 19e424a

Browse files
LordSimalKevin Pfeiferclaude
authored
Update to Rector 2.7 (#199)
Co-authored-by: Kevin Pfeifer <kevin@KP-MBP16M4-2025.local> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 3b3e69c commit 19e424a

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"phpstan": "tools/phpstan analyse",
6767
"stan-baseline": "tools/phpstan --generate-baseline",
6868
"stan-setup": "phive install",
69-
"rector-setup": "cp composer.json composer.backup && composer require --dev rector/rector:\"^2.2\" && mv composer.backup composer.json",
69+
"rector-setup": "cp composer.json composer.backup && composer require --dev rector/rector:\"^2.7\" && mv composer.backup composer.json",
7070
"rector-check": "vendor/bin/rector process --dry-run",
7171
"rector-fix": "vendor/bin/rector process",
7272
"test": "phpunit",

‎rector.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22
declare(strict_types=1);
33

4-
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
54
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
65
use Rector\Config\RectorConfig;
6+
use Rector\DeadCode\Rector\ClassMethod\RemoveMixedDocblockOverruledByNativeTypeRector;
77
use Rector\DeadCode\Rector\ClassMethod\RemoveNullTagValueNodeRector;
88
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
9-
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
9+
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessUnionReturnDocblockRector;
1010
use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockReturnArrayFromDirectArrayInstanceRector;
1111
use Rector\ValueObject\PhpVersion;
1212

@@ -17,11 +17,11 @@
1717
__DIR__ . '/tests',
1818
])
1919
->withSkip([
20-
DisallowedEmptyRuleFixerRector::class,
21-
SimplifyIfElseToTernaryRector::class,
2220
MakeInheritedMethodVisibilitySameAsParentRector::class,
2321
RemoveNullTagValueNodeRector::class,
2422
RemoveUselessReturnTagRector::class,
23+
RemoveUselessUnionReturnDocblockRector::class,
24+
RemoveMixedDocblockOverruledByNativeTypeRector::class,
2525
DocblockReturnArrayFromDirectArrayInstanceRector::class => [
2626
__DIR__ . '/src/Mailer/Transport/QueueTransport.php',
2727
],

‎src/Queue/Processor.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function processMessage(Message $message): string|object
122122
$callable = $message->getCallable();
123123
$response = $callable($message);
124124
if ($response === null) {
125-
$response = InteropProcessor::ACK;
125+
return InteropProcessor::ACK;
126126
}
127127

128128
return $response;

‎src/QueueManager.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public static function setConfig(string|array $key, ?array $config = null): void
9191
}
9292

9393
return;
94-
} elseif (is_array($key)) {
94+
}
95+
96+
if (is_array($key)) {
9597
throw new LogicException('If config is not null, key must be a string.');
9698
}
9799

‎tests/test_app/src/Queue/TestCustomProcessor.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function processMessage(Message $message): string|object
110110
$callable = $message->getCallable();
111111
$response = $callable($message);
112112
if ($response === null) {
113-
$response = InteropProcessor::ACK;
113+
return InteropProcessor::ACK;
114114
}
115115

116116
return $response;

0 commit comments

Comments
 (0)