8000 bug #40758 [Security] NullToken signature (jderusse) · symfony/security-core@f885ecd · GitHub
[go: up one dir, main page]

Skip to content

Commit f885ecd

Browse files
committed
bug #40758 [Security] NullToken signature (jderusse)
This PR was merged into the 5.2 branch. Discussion ---------- [Security] NullToken signature | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - The signature of `TokenInterface::getUser` does not allow returning null. But `NullToken` returns `null`. https://github.com/symfony/symfony/blob/0f96ac74847d114c9d9679655bcf3e94b6ba69d1/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php#L49-L56 This PR update `NullToken::getUser` to return an empty string instead of null. I wonder if the fix shouldn't be to change the return type in the interface, but that would be a BC break, right? Commits ------- 9ad3720efc [security] NullToken signature
2 parents bc9e604 + 3db3098 commit f885ecd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Authentication/Token/NullToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getCredentials()
3333

3434
public function getUser()
3535
{
36-
return null;
36+
return '';
3737
}
3838

3939
public function setUser($user)

0 commit comments

Comments
 (0)
0