8000 feature #52160 [DoctrineBridge] Change argument `$lastUsed` of `Doctr… · symfony/symfony@eee7e8f · GitHub
[go: up one dir, main page]

Skip to content

Commit eee7e8f

Browse files
feature #52160 [DoctrineBridge] Change argument $lastUsed of DoctrineTokenProvider::updateToken() to accept DateTimeInterface (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- [DoctrineBridge] Change argument `$lastUsed` of `DoctrineTokenProvider::updateToken()` to accept `DateTimeInterface` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT To preserve compat between the bridge v6 and security-core v7. Commits ------- 18211bd [DoctrineBridge] Change argument `$lastUsed` of `DoctrineTokenProvider::updateToken()` to accept `DateTimeInterface`
2 parents 2f247cf + 18211bd commit eee7e8f

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

.github/expected-missing-return-types.diff

+1-8
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,7 @@ diff --git a/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvid
266266
+ public function deleteTokenBySeries(string $series): void
267267
{
268268
$sql = 'DELETE FROM rememberme_token WHERE series=:series';
269-
@@ -83,5 +83,5 @@ class DoctrineTokenProvider implements TokenProviderInterface, TokenVerifierInte
270-
* @return void
271-
*/
272-
- public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed)
273-
+ public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed): void
274-
{
275-
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed WHERE series=:series';
276-
@@ -105,5 +105,5 @@ class DoctrineTokenProvider implements TokenProviderInterface, TokenVerifierInte
269+
@@ -100,5 +100,5 @@ class DoctrineTokenProvider implements TokenProviderInterface, TokenVerifierInte
277270
* @return void
278271
*/
279272
- public function createNewToken(PersistentTokenInterface $token)

UPGRADE-6.4.md

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ DoctrineBridge
9999
* Deprecate not constructing `DoctrineDataCollector` with an instance of `DebugDataHolder`
100100
* Deprecate `DoctrineDataCollector::addLogger()`, use a `DebugDataHolder` instead
101101
* Deprecate `ContainerAwareLoader`, use dependency injection in your fixtures instead
102+
* [BC Break] Change argument `$lastUsed` of `DoctrineTokenProvider::updateToken()` to accept `DateTimeInterface`
102103

103104
DomCrawler
104105
----------

src/Symfony/Bridge/Doctrine/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99
* Deprecate `DoctrineDataCollector::addLogger()`, use a `DebugDataHolder` instead
1010
* Deprecate `ContainerAwareLoader`, use dependency injection in your fixtures instead
1111
* Always pass the `Request` object to `EntityValueResolver`'s expression
12+
* [BC BREAK] Change argument `$lastUsed` of `DoctrineTokenProvider::updateToken()` to accept `DateTimeInterface`
1213

1314
6.3
1415
---

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ public function deleteTokenBySeries(string $series)
7777
$this->conn->executeStatement($sql, $paramValues, $paramTypes);
7878
}
7979

80-
/**
81-
* @param \DateTimeInterface $lastUsed Accepting only DateTime is deprecated since Symfony 6.4
82-
*
83-
* @return void
84-
*/
85-
public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed)
80+
public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed): void
8681
{
8782
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed WHERE series=:series';
8883
$paramValues = [

src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RememberMeBundle/Security/StaticTokenProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function deleteTokenBySeries(string $series): void
4444
unset(self::$db[$series]);
4545
}
4646

47-
public function updateToken(string $series, string $tokenValue, \DateTime $lastUsed): void
47+
public function updateToken(string $series, string $tokenValue, \DateTimeInterface $lastUsed): void
4848
{
4949
$token = $this->loadTokenBySeries($series);
5050
$refl = new \ReflectionClass($token);

0 commit comments

Comments
 (0)
0