Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fb234d5

Browse filesBrowse files
minor #50289 [Messenger] Use immutable dates in the storage when using Doctrine (nicolas-grekas)
This PR was merged into the 6.3 branch. Discussion ---------- [Messenger] Use immutable dates in the storage when using Doctrine | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Part of #47580 | License | MIT | Doc PR | - We already started using `DateTimeImmutable` in that class but we missed these updates. Commits ------- d6563a1 [Messenger] Use immutable dates in the storage when using Doctrine
2 parents 3b29817 + d6563a1 commit fb234d5
Copy full SHA for fb234d5

File tree

Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Filter options
  • src/Symfony/Component/Messenger/Bridge/Doctrine/Transport
Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed

‎src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ public function send(string $body, array $headers, int $delay = 0): string
148148
null,
149149
null,
150150
null,
151-
Types::DATETIME_MUTABLE,
152-
Types::DATETIME_MUTABLE,
151+
Types::DATETIME_IMMUTABLE,
152+
Types::DATETIME_IMMUTABLE,
153153
]);
154154

155155
return $this->driverConnection->lastInsertId();
@@ -226,7 +226,7 @@ public function get(): ?array
226226
$now,
227227
$doctrineEnvelope['id'],
228228
], [
229-
Types::DATETIME_MUTABLE,
229+
Types::DATETIME_IMMUTABLE,
230230
]);
231231

232232
$this->driverConnection->commit();
@@ -354,8 +354,8 @@ private function createAvailableMessagesQueryBuilder(): QueryBuilder
354354
$now,
355355
$this->configuration['queue_name'],
356356
], [
357-
Types::DATETIME_MUTABLE,
358-
Types::DATETIME_MUTABLE,
357+
Types::DATETIME_IMMUTABLE,
358+
Types::DATETIME_IMMUTABLE,
359359
]);
360360
}
361361

@@ -449,11 +449,11 @@ private function addTableToSchema(Schema $schema): void
449449
$table->addColumn('queue_name', Types::STRING)
450450
->setLength(190) // MySQL 5.6 only supports 191 characters on an indexed column in utf8mb4 mode
451451
->setNotnull(true);
452-
$table->addColumn('created_at', Types::DATETIME_MUTABLE)
452+
$table->addColumn('created_at', Types::DATETIME_IMMUTABLE)
453453
->setNotnull(true);
454-
$table->addColumn('available_at', Types::DATETIME_MUTABLE)
454+
$table->addColumn('available_at', Types::DATETIME_IMMUTABLE)
455455
->setNotnull(true);
456-
$table->addColumn('delivered_at', Types::DATETIME_MUTABLE)
456+
$table->addColumn('delivered_at', Types::DATETIME_IMMUTABLE)
457457
->setNotnull(false);
458458
$table->setPrimaryKey(['id']);
459459
$table->addIndex(['queue_name']);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.