Skip to content

Commit 785b61d

Browse files
committed
[Security] Improve method signatures (minor)
1 parent a7b8a49 commit 785b61d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Authenticator/FormLoginAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function authenticate(Request $request): PassportInterface
100100
/**
101101
* @param Passport $passport
102102
*/
103-
public function createAuthenticatedToken(PassportInterface $passport, $firewallName): TokenInterface
103+
public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface
104104
{
105105
return new UsernamePasswordToken($passport->getUser(), null, $firewallName, $passport->getUser()->getRoles());
106106
}

Authenticator/HttpBasicAuthenticator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(string $realmName, UserProviderInterface $userProvid
4747
$this->logger = $logger;
4848
}
4949

50-
public function start(Request $request, AuthenticationException $authException = null)
50+
public function start(Request $request, AuthenticationException $authException = null): Response
5151
{
5252
$response = new Response();
5353
$response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));
@@ -82,12 +82,12 @@ public function authenticate(Request $request): PassportInterface
8282
/**
8383
* @param Passport $passport
8484
*/
85-
public function createAuthenticatedToken(PassportInterface $passport, $firewallName): TokenInterface
85+
public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface
8686
{
8787
return new UsernamePasswordToken($passport->getUser(), null, $firewallName, $passport->getUser()->getRoles());
8888
}
8989

90-
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $firewallName): ?Response
90+
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
9191
{
9292
return null;
9393
}

Authenticator/Passport/SelfValidatingPassport.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Http\Authenticator\Passport;
1313

1414
use Symfony\Component\Security\Core\User\UserInterface;
15+
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\BadgeInterface;
1516

1617
/**
1718
* An implementation used when there are no credentials to be checked (e.g.
@@ -23,6 +24,9 @@
2324
*/
2425
class SelfValidatingPassport extends Passport
2526
{
27+
/**
28+
* @param BadgeInterface[] $badges
29+
*/
2630
public function __construct(UserInterface $user, array $badges = [])
2731
{
2832
$this->user = $user;

0 commit comments

Comments
 (0)