8000 improve dx and document auth exception · symfony/symfony@97ceba0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97ceba0

Browse files
committed
improve dx and document auth exception
1 parent b5d1cbc commit 97ceba0

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/Symfony/Component/Security/Http/Authenticator/Passport/Badge/UserBadge.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Security\Http\Authenticator\Passport\Badge;
1313

14+
use Symfony\Component\Security\Core\Exception\AuthenticationException;
1415
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
1516
use Symfony\Component\Security\Core\User\UserInterface;
1617
use Symfony\Component\Security\Http\EventListener\UserProviderListener;
@@ -55,6 +56,9 @@ public function getUserIdentifier(): string
5556
return $this->userIdentifier;
5657
}
5758

59+
/**
60+
* @throws AuthenticationException when the user cannot be found
61+
*/
5862
public function getUser(): UserInterface
5963
{
6064
if (null === $this->user) {

src/Symfony/Component/Security/Http/Authenticator/Passport/Passport.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public function __construct($userBadge, CredentialsInterface $credentials, array
5555
}
5656
}
5757

58+
/**
59+
* {@inheritdoc}
60+
*/
5861
public function getUser(): UserInterface
5962
{
6063
if (null === $this->user) {

src/Symfony/Component/Security/Http/Authenticator/Passport/UserPassportInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Security\Http\Authenticator\Passport;
1313

14+
use Symfony\Component\Security\Core\Exception\AuthenticationException;
1415
use Symfony\Component\Security\Core\User\UserInterface;
1516

1617
/**
@@ -22,5 +23,8 @@
2223
*/
2324
interface UserPassportInterface extends PassportInterface
2425
{
26+
/**
27+
* @throws AuthenticationException when the user cannot be found
28+
*/
2529
public function getUser(): UserInterface;
2630
}

0 commit comments

Comments
 (0)
0