Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Security] Replace deprecatedPassportInterface occurrences byPassport#15594
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| } | ||
| public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface | ||
| public function createAuthenticatedToken(Passport $passport, string $firewallName): TokenInterface |
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.
The method should also be renamed, right?
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.
I renamed while merging ... but I have a question. The new code is:
publicfunctioncreateAuthenticatedToken(PassportInterface$passport,string$firewallName):TokenInterface{trigger_deprecation('symfony/ldap','5.4','Method "%s()" is deprecated, use "%s::createToken()" instead.',__METHOD__,__CLASS__);return$this->createToken($passport,$firewallName);}publicfunctioncreateToken(PassportInterface$passport,string$firewallName):TokenInterface{// @deprecated since Symfony 5.4, in 6.0 change to:// return $this->authenticator->createToken($passport, $firewallName);returnmethod_exists($this->authenticator,'createToken') ?$this->authenticator->createToken($passport,$firewallName) :$this->authenticator->createAuthenticatedToken($passport,$firewallName);}
So, the method iscreateToken(PassportInterface $passport, ...) but in the docs we usecreateToken(Passport $passport, ...) Do you see a problem here? Thanks!
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.
That is a typo in the LDAP authenticator indeed. Other authenticators (including the interface) usecreateToken(Passport $passport, ...)
(and it's not a PHP error, as it's widening the scope of the interface, and thus allowed)
PassportInterface occurrences byPassportPassportInterface occurrences byPassportjaviereguiluz commentedAug 9, 2021
Thank you Robin. |
Fixes#15593