Skip to content

Commit 95064b1

Browse files
loks0nclaude
andcommitted
Use constructor property promotion for Redis $receive
$commands keeps its body assignment because of the `?? $receive` fallback, but $receive is a plain assignment and can be promoted (as the broker's original single connection was). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2be4c1b commit 95064b1

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎src/Queue/Broker/Redis.php‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ class Redis implements Publisher, Consumer
1414
private const int RECONNECT_BACKOFF_MS = 100;
1515
private const int RECONNECT_MAX_BACKOFF_MS = 5_000;
1616

17-
/** Drives the blocking receive loop and its claim writes (single caller). */
18-
private readonly Connection $receive;
19-
2017
/** Carries acks and publishing; wrap in Locking when shared by coroutines. */
2118
private readonly Connection $commands;
2219

@@ -33,10 +30,10 @@ class Redis implements Publisher, Consumer
3330
private $reconnectSuccessCallback = null;
3431

3532
public function __construct(
36-
Connection $receive,
33+
// Drives the blocking receive loop and its claim writes (single caller).
34+
private readonly Connection $receive,
3735
?Connection $commands = null,
3836
) {
39-
$this->receive = $receive;
4037
$this->commands = $commands ?? $receive;
4138
}
4239

0 commit comments

Comments
 (0)