Skip to content

Commit 6c46f31

Browse files
committed
Don't need the logger context unless logging
1 parent b48b32d commit 6c46f31

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Client/Auth/WebsocketAuthenticationProvider.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,10 @@ public function authenticate(ConnectionInterface $conn): TokenInterface
4242
}
4343
}
4444

45-
$loggerContext = [
46-
'connection_id' => $conn->resourceId,
47-
'session_id' => $conn->WAMP->sessionId,
48-
];
49-
5045
$token = $this->getToken($conn);
5146

5247
$identifier = $this->clientStorage->getStorageId($conn);
5348

54-
$loggerContext['storage_id'] = $identifier;
5549
$this->clientStorage->addClient($identifier, $token);
5650

5751
if (null !== $this->logger) {
@@ -60,7 +54,11 @@ public function authenticate(ConnectionInterface $conn): TokenInterface
6054
'%s connected',
6155
method_exists($token, 'getUserIdentifier') ? $token->getUserIdentifier() : $token->getUsername()
6256
),
63-
$loggerContext
57+
[
58+
'connection_id' => $conn->resourceId,
59+
'session_id' => $conn->WAMP->sessionId,
60+
'storage_id' => $identifier,
61+
]
6462
);
6563
}
6664

0 commit comments

Comments
 (0)