8000 minor #32208 [Csrf] Added type-hint for CsrfTokenMangerInterface (jul… · symfony/symfony@aaf3ae0 · GitHub
[go: up one dir, main page]

Skip to content

Commit aaf3ae0

Browse files
committed
minor #32208 [Csrf] Added type-hint for CsrfTokenMangerInterface (julien57)
This PR was merged into the 5.0-dev branch. Discussion ---------- [Csrf] Added type-hint for CsrfTokenMangerInterface | Q | A | ------------- | --- | Branch? | Master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32179 | License | MIT | Doc PR | symfony/symfony-docs#.. Add type-hints in PR for CsrfTokenManagerInterface & CsrfTokenManager component. Commits ------- 44e5b0b removed return values
2 parents f2b261d + 44e5b0b commit aaf3ae0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Symfony/Component/Security/Csrf/CsrfTokenManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct(TokenGeneratorInterface $generator = null, TokenStor
6666
/**
6767
* {@inheritdoc}
6868
*/
69-
public function getToken($tokenId)
69+
public function getToken(string $tokenId)
7070
{
7171
$namespacedId = $this->getNamespace().$tokenId;
7272
if ($this->storage->hasToken($namespacedId)) {
@@ -83,7 +83,7 @@ public function getToken($tokenId)
8383
/**
8484
* {@inheritdoc}
8585
*/
86-
public function refreshToken($tokenId)
86+
public function refreshToken(string $tokenId)
8787
{
8888
$namespacedId = $this->getNamespace().$tokenId;
8989
$value = $this->generator->generateToken();
@@ -96,7 +96,7 @@ public function refreshToken($tokenId)
9696
/**
9797
* {@inheritdoc}
9898
*/
99-
public function removeToken($tokenId)
99+
public function removeToken(string $tokenId)
100100
{
101101
return $this->storage->removeToken($this->getNamespace().$tokenId);
102102
}

src/Symfony/Component/Security/Csrf/CsrfTokenManagerInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface CsrfTokenManagerInterface
3030
*
3131
* @return CsrfToken The CSRF token
3232
*/
33-
public function getToken($tokenId);
33+
public function getToken(string $tokenId);
3434

3535
/**
3636
* Generates a new token value for the given ID.
@@ -44,7 +44,7 @@ public function getToken($tokenId);
4444
*
4545
* @return CsrfToken The CSRF token
4646
*/
47-
public function refreshToken($tokenId);
47+
public function refreshToken(string $tokenId);
4848

4949
/**
5050
* Invalidates the CSRF token with the given ID, if one exists.
@@ -54,7 +54,7 @@ public function refreshToken($tokenId);
5454
* @return string|null Returns the removed token value if one existed, NULL
5555
* otherwise
5656
*/
57-
public function removeToken($tokenId);
57+
public function removeToken(string $tokenId);
5858

5959
/**
6060
* Returns whether the given CSRF token is valid.

0 commit comments

Comments
 (0)
0