Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6e09f92

Browse filesBrowse files
minor #37339 [Security/Http] Remove unnecessary null check (scheb)
This PR was merged into the 5.1 branch. Discussion ---------- [Security/Http] Remove unnecessary null check | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a Just found this piece of code, it checks if `$this->eventDispatcher` is null, but actually it cannot be null. The constructor argument is non-nullable and a few lines further up it is used without the null check. So I'd recommend to remove the statement. Commits ------- a74a506 Remove unnecessary null check
2 parents 4773c5e + a74a506 commit 6e09f92
Copy full SHA for 6e09f92

File tree

Expand file treeCollapse file tree

1 file changed

+1
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-3
lines changed

‎src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ private function executeAuthenticator(AuthenticatorInterface $authenticator, Req
171171
$authenticatedToken->eraseCredentials();
172172
}
173173

174-
if (null !== $this->eventDispatcher) {
175-
$this->eventDispatcher->dispatch(new AuthenticationSuccessEvent($authenticatedToken), AuthenticationEvents::AUTHENTICATION_SUCCESS);
176-
}
174+
$this->eventDispatcher->dispatch(new AuthenticationSuccessEvent($authenticatedToken), AuthenticationEvents::AUTHENTICATION_SUCCESS);
177175

178176
if (null !== $this->logger) {
179177
$this->logger->info('Authenticator successful!', ['token' => $authenticatedToken, 'authenticator' => \get_class($authenticator)]);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.