8000 minor #46913 Check for null instead of type (ihmels) · symfony/symfony@e113442 · GitHub
[go: up one dir, main page]

Skip to content
8000

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)
0