Skip to content

Commit 5940472

Browse files
authored
Simplify OAuthEventClass documentation (#678)
As the `$event->getClient()` method [returns a ClientInterface](https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/blob/master/Event/AbstractAuthorizationEvent.php#L59), there is no need to check that this value is not null
1 parent 446f0c5 commit 5940472

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Resources/doc/the_oauth_event_class.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ class OAuthEventListener
3939
public function onPostAuthorization(PostAuthorizationEvent $event)
4040
{
4141
if ($event->isAuthorizedClient()) {
42-
if (null !== $client = $event->getClient()) {
43-
$user = $this->getUser($event);
44-
$user->addClient($client);
45-
$user->save();
46-
}
42+
$user = $this->getUser($event);
43+
$user->addClient($event->getClient());
44+
$user->save();
4745
}
4846
}
4947

0 commit comments

Comments
 (0)