Skip to content

Commit a15ea6f

Browse files
committed
stan fix
1 parent 8829560 commit a15ea6f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Types/SymfonyUserInterfaceType.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ class SymfonyUserInterfaceType
2020
*/
2121
public function getUserName(UserInterface $user): string
2222
{
23-
// @phpstan-ignore-next-line Forward Compatibility for Symfony 5.3
23+
// @phpstan-ignore-next-line Forward Compatibility for Symfony >=5.3
2424
if (method_exists($user, 'getUserIdentifier')) {
2525
return $user->getUserIdentifier();
2626
}
2727

28-
if (method_exists($user, 'getUserName')) {
29-
return $user->getUserName();
28+
// @phpstan-ignore-next-line Backward Compatibility for Symfony <5.3
29+
if (method_exists($user, 'getUsername')) {
30+
return $user->getUsername();
3031
}
3132

3233
throw FieldNotFoundException::missingField(UserInterface::class, 'userName');

0 commit comments

Comments
 (0)