Skip to content

Commit e113442

Browse files
committed
minor #46913 Check for null instead of type (ihmels)
This PR was submitted for the 6.2 branch but it was merged into the 5.4 branch instead. Discussion ---------- Check for null instead of type | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a `LogoutEvent::getResponse()` returns a `Response` or `null`, so it is not necessary to check the type, but whether the value is null. Commits ------- f545be9 Check for null instead of type
2 parents 540ba26 + f545be9 commit e113442

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Component/Security/Http/Firewall/LogoutListener.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ public function authenticate(RequestEvent $event)
121121
$logoutEvent = new LogoutEvent($request, $this->tokenStorage->getToken());
122122
$this->eventDispatcher->dispatch($logoutEvent);
123123

124-
$response = $logoutEvent->getResponse();
125-
if (!$response instanceof Response) {
124+
if (!$response = $logoutEvent->getResponse()) {
126125
throw new \RuntimeException('No logout listener set the Response, make sure at least the DefaultLogoutListener is registered.');
127126
}
128127

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy