-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fix misleading TokenInterface docblock 2.3 #12597
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
Fix misleading TokenInterface docblock 2.3 #12597
Conversation
* @return mixed either returns an object which implements __toString(), or | ||
* a primitive string is returned. | ||
* @return mixed either returns an object which implements Symfony\Component\Security\Core\User\UserInterface, | ||
* or a primitive string is returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"or a primitive string." would be enough as the verb is already earlier in the sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I'll fix it.
066f9aa
to
f2e0c53
Compare
f2e0c53
to
9783f1b
Compare
@@ -47,8 +47,8 @@ public function getCredentials(); | |||
/** | |||
* Returns a user representation. | |||
* | |||
* @return mixed either returns an object which implements __toString(), or | |||
* a primitive string is returned. | |||
* @return mixed Either returns an object which implements Symfony\Component\Security\Core\User\UserInterface, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should keep the "object which implements __toString()" as well.
This PR was merged into the 2.3 branch. Discussion ---------- [Security] fixed wrong phpdoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12597 | License | MIT | Doc PR | n/a Commits ------- 064062d [Security] fixed wrong phpdoc
I've found the docblock for
TokenInterface::getUser
misleading. By reading it I've written something like:This actually doesn't work, since
UserInterface
doesn't implements__toString
and I have some instance ofAdvancedUser
(coming from InMemory provider).If the token always return a
UserInterface
or string, then my fix is ok.[fix my PR #12596]