Skip to content

Commit c064236

Browse files
committed
Removing no needed types
1 parent 6fbbf30 commit c064236

File tree

2 files changed

+11
-27
lines changed

2 files changed

+11
-27
lines changed

src/PostgresLazyTransaction.php

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,15 @@ public function __construct(
3838

3939
public function recordOutboxes(array $outboxes): void
4040
{
41-
/**
42-
* @var list<string> $insertData
43-
*/
4441
$insertData = [];
4542

46-
/**
47-
* @var list<string> $placeholders
48-
*/
4943
$placeholders = [];
50-
/**
51-
* @var Outbox $outbox
52-
*/
44+
5345
foreach ($outboxes as $outbox) {
54-
array_push($insertData,
55-
$this->endpoint->toString(),
56-
$outbox->incomingMessageId,
57-
new PostgresByteA(serialize($outbox->commands)),
58-
new PostgresByteA(serialize($outbox->events)),
59-
);
46+
$insertData[] = $this->endpoint->toString();
47+
$insertData[] = $outbox->incomingMessageId;
48+
$insertData[] = new PostgresByteA(serialize($outbox->commands));
49+
$insertData[] = new PostgresByteA(serialize($outbox->events));
6050

6151
$placeholders[] = '(?, ?, ?, ?,' . ($outbox->dispatched ? 'now()' : 'null') . ')';
6252
}
@@ -72,13 +62,13 @@ public function recordOutboxes(array $outboxes): void
7262
SQL,
7363
$insertData,
7464
);
75-
76-
if ($result->getRowCount() !== count($outboxes)) {
77-
throw new OutboxAlreadyExists();
78-
}
7965
} catch (SqlTransactionError $exception) {
8066
throw new TransactionClosed(previous: $exception);
8167
}
68+
69+
if ($result->getRowCount() !== count($outboxes)) {
70+
throw new OutboxAlreadyExists();
71+
}
8272
}
8373

8474
public function commitIfBegun(): void

src/PostgresStorage.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ final class PostgresStorage implements Storage
2828
* @param non-empty-string $outboxTable
2929
*/
3030
public function __construct(
31-
private PostgresLink $postgres,
32-
private string $outboxTable = 'outbox',
31+
private readonly PostgresLink $postgres,
32+
private readonly string $outboxTable = 'outbox',
3333
) {}
3434

3535
public function setup(): void
@@ -50,9 +50,6 @@ public function setup(): void
5050
);
5151
}
5252

53-
/**
54-
* @return LazyTransaction<AmphpPostgresTransaction>
55-
*/
5653
public function createLazyTransaction(Endpoint $endpoint): LazyTransaction
5754
{
5855
return new PostgresLazyTransaction(
@@ -77,9 +74,6 @@ public function findOutboxes(Endpoint $endpoint, array $incomingMessageIds): arr
7774
[$endpoint->toString(), ...$incomingMessageIds],
7875
);
7976

80-
/**
81-
* @var list<Outbox> $outboxes
82-
*/
8377
$outboxes = [];
8478

8579
while (null !== $row = $result->fetchRow()) {

0 commit comments

Comments
 (0)