Skip to content

[DoctrineBridge] Change argument $lastUsed of DoctrineTokenProvider::updateToken() to accept DateTimeInterface #52160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/expected-missing-return-types.diff
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,7 @@ diff --git a/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvid
+ public function deleteTokenBySeries(string $series): void
{
$sql = 'DELETE FROM rememberme_token WHERE series=:series';
@@ -83,5 +83,5 @@ class DoctrineTokenProvider implements TokenProviderInterface, TokenVerifierInte
* @return void
*/
- public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed)
+ public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed): void
{
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed WHERE series=:series';
@@ -105,5 +105,5 @@ class DoctrineTokenProvider implements TokenProviderInterface, TokenVerifierInte
@@ -100,5 +100,5 @@ class DoctrineTokenProvider implements TokenProviderInterface, TokenVerifierInte
* @return void
*/
- public function createNewToken(PersistentTokenInterface $token)
Expand Down
1 change: 1 addition & 0 deletions UPGRADE-6.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ DoctrineBridge
* Deprecate not constructing `DoctrineDataCollector` with an instance of `DebugDataHolder`
* Deprecate `DoctrineDataCollector::addLogger()`, use a `DebugDataHolder` instead
* Deprecate `ContainerAwareLoader`, use dependency injection in your fixtures instead
* [BC Break] Change argument `$lastUsed` of `DoctrineTokenProvider::updateToken()` to accept `DateTimeInterface`

DomCrawler
----------
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bridge/Doctrine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CHANGELOG
* Deprecate `DoctrineDataCollector::addLogger()`, use a `DebugDataHolder` instead
* Deprecate `ContainerAwareLoader`, use dependency injection in your fixtures instead
* Always pass the `Request` object to `EntityValueResolver`'s expression
* [BC BREAK] Change argument `$lastUsed` of `DoctrineTokenProvider::updateToken()` to accept `DateTimeInterface`

6.3
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ public function deleteTokenBySeries(string $series)
$this->conn->executeStatement($sql, $paramValues, $paramTypes);
}

/**
* @param \DateTimeInterface $lastUsed Accepting only DateTime is deprecated since Symfony 6.4
*
* @return void
*/
public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed)
public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed): void
{
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed WHERE series=:series';
$paramValues = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function deleteTokenBySeries(string $series): void
unset(self::$db[$series]);
}

public function updateToken(string $series, string $tokenValue, \DateTime $lastUsed): void
public function updateToken(string $series, string $tokenValue, \DateTimeInterface $lastUsed): void
{
$token = $this->loadTokenBySeries($series);
$refl = new \ReflectionClass($token);
Expand Down