@@ -101,12 +101,16 @@ public function doAuthenticate(Request $request) /* : Passport */
101
101
/** @var string $oauthClientId */
102
102
$ oauthClientId = $ psr7Request ->getAttribute ('oauth_client_id ' , '' );
103
103
104
+ /** @psalm-suppress MixedInferredReturnType */
104
105
$ userLoader = function (string $ userIdentifier ): UserInterface {
105
106
if ('' === $ userIdentifier ) {
106
107
return new NullUser ();
107
108
}
108
109
if (!method_exists ($ this ->userProvider , 'loadUserByIdentifier ' )) {
109
- /** @psalm-suppress DeprecatedMethod */
110
+ /**
111
+ * @psalm-suppress DeprecatedMethod
112
+ * @psalm-suppress MixedReturnStatement
113
+ */
110
114
return $ this ->userProvider ->loadUserByUsername ($ userIdentifier );
111
115
}
112
116
@@ -127,6 +131,9 @@ public function doAuthenticate(Request $request) /* : Passport */
127
131
* @return OAuth2Token
128
132
*
129
133
* @psalm-suppress DeprecatedInterface
134
+ * @psalm-suppress UndefinedClass
135
+ * @psalm-suppress MixedInferredReturnType
136
+ * @psalm-suppress RedundantCondition
130
137
*/
131
138
public function createAuthenticatedToken (PassportInterface $ passport , string $ firewallName ): TokenInterface
132
139
{
@@ -135,6 +142,10 @@ public function createAuthenticatedToken(PassportInterface $passport, string $fi
135
142
}
136
143
137
144
$ token = $ this ->createToken ($ passport , $ firewallName );
145
+ /**
146
+ * @psalm-suppress TooManyArguments
147
+ * @psalm-suppress UndefinedMethod
148
+ */
138
149
$ token ->setAuthenticated (true );
139
150
140
151
return $ token ;
@@ -157,7 +168,10 @@ public function createToken(Passport $passport, string $firewallName): TokenInte
157
168
$ token = new OAuth2Token ($ passport ->getUser (), $ accessTokenId , $ oauthClientId , $ scopeBadge ->getScopes (), $ this ->rolePrefix );
158
169
if (method_exists (AuthenticatorInterface::class, 'createAuthenticatedToken ' ) && !method_exists (AuthenticatorInterface::class, 'createToken ' )) {
159
170
// symfony 5.4 only
160
- /** @psalm-suppress TooManyArguments */
171
+ /**
172
+ * @psalm-suppress TooManyArguments
173
+ * @psalm-suppress UndefinedMethod
174
+ */
161
175
$ token ->setAuthenticated (true , false );
162
176
}
163
177
0 commit comments