Skip to content

Commit f086e5a

Browse files
wouterjnicolas-grekas
authored andcommitted
Add remaining missing return types to safe methods
1 parent 28437ba commit f086e5a

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

Authenticator/JsonLoginAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function isInteractive(): bool
137137
return true;
138138
}
139139

140-
public function setTranslator(TranslatorInterface $translator)
140+
public function setTranslator(TranslatorInterface $translator): void
141141
{
142142
$this->translator = $translator;
143143
}

Event/LazyResponseEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(parent $event)
3131
$this->event = $event;
3232
}
3333

34-
public function setResponse(Response $response)
34+
public function setResponse(Response $response): never
3535
{
3636
$this->stopPropagation();
3737
$this->event->stopPropagation();

Firewall/AccessListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ public function supports(Request $request): ?bool
6060
/**
6161
* Handles access authorization.
6262
*
63-
* @void
64-
*
6563
* @throws AccessDeniedException
6664
*/
67-
public function authenticate(RequestEvent $event)
65+
public function authenticate(RequestEvent $event): void
6866
{
6967
$request = $event->getRequest();
7068

Firewall/ContextListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ protected function refreshUser(TokenInterface $token): ?TokenInterface
251251
throw new \RuntimeException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $userClass));
252252
}
253253

254-
private function safelyUnserialize(string $serializedToken)
254+
private function safelyUnserialize(string $serializedToken): mixed
255255
{
256256
$token = null;
257257
$prevUnserializeHandler = ini_set('unserialize_callback_func', __CLASS__.'::handleUnserializeCallback');
@@ -323,7 +323,7 @@ private static function hasUserChanged(UserInterface $originalUser, TokenInterfa
323323
/**
324324
* @internal
325325
*/
326-
public static function handleUnserializeCallback(string $class)
326+
public static function handleUnserializeCallback(string $class): never
327327
{
328328
throw new \ErrorException('Class not found: '.$class, 0x37313BC);
329329
}

Firewall/ExceptionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ protected function setTargetPath(Request $request): void
225225
}
226226
}
227227

228-
private function throwUnauthorizedException(AuthenticationException $authException)
228+
private function throwUnauthorizedException(AuthenticationException $authException): never
229229
{
230230
$this->logger?->notice(sprintf('No Authentication entry point configured, returning a %s HTTP response. Configure "entry_point" on the firewall "%s" if you want to modify the response.', Response::HTTP_UNAUTHORIZED, $this->firewallName));
231231

0 commit comments

Comments
 (0)