@@ -59,7 +59,7 @@ public function __construct(ChannelManager $channelManager, StatisticsDriver $dr
59
59
public function webSocketMessage ($ appId )
60
60
{
61
61
$ this ->ensureAppIsSet ($ appId )
62
- ->__call ( ' hincrby ' , [ $ this ->getHash ($ appId ), 'websocket_message_count ' , 1 ] );
62
+ ->hincrby ( $ this ->getHash ($ appId ), 'websocket_message_count ' , 1 );
63
63
}
64
64
65
65
/**
@@ -71,7 +71,7 @@ public function webSocketMessage($appId)
71
71
public function apiMessage ($ appId )
72
72
{
73
73
$ this ->ensureAppIsSet ($ appId )
74
- ->__call ( ' hincrby ' , [ $ this ->getHash ($ appId ), 'api_message_count ' , 1 ] );
74
+ ->hincrby ( $ this ->getHash ($ appId ), 'api_message_count ' , 1 );
75
75
}
76
76
77
77
/**
@@ -84,13 +84,13 @@ public function connection($appId)
84
84
{
85
85
// Increment the current connections count by 1.
86
86
$ incremented = $ this ->ensureAppIsSet ($ appId )
87
- ->__call ( ' hincrby ' , [ $ this ->getHash ($ appId ), 'current_connection_count ' , 1 ] );
87
+ ->hincrby ( $ this ->getHash ($ appId ), 'current_connection_count ' , 1 );
88
88
89
89
$ incremented ->then (function ($ currentConnectionCount ) use ($ appId ) {
90
90
// Get the peak connections count from Redis.
91
91
$ peakConnectionCount = $ this ->replicator
92
92
->getPublishClient ()
93
- ->__call ( ' hget ' , [ $ this ->getHash ($ appId ), 'peak_connection_count ' ] );
93
+ ->hget ( $ this ->getHash ($ appId ), 'peak_connection_count ' );
94
94
95
95
$ peakConnectionCount ->then (function ($ currentPeakConnectionCount ) use ($ currentConnectionCount , $ appId ) {
96
96
// Extract the greatest number between the current peak connection count
@@ -103,7 +103,7 @@ public function connection($appId)
103
103
// Then set it to the database.
104
104
$ this ->replicator
105
105
->getPublishClient ()
106
- ->__call ( ' hset ' , [ $ this ->getHash ($ appId ), 'peak_connection_count ' , $ peakConnectionCount] );
106
+ ->hset ( $ this ->getHash ($ appId ), 'peak_connection_count ' , $ peakConnectionCount );
107
107
});
108
108
});
109
109
}
@@ -118,13 +118,13 @@ public function disconnection($appId)
118
118
{
119
119
// Decrement the current connections count by 1.
120
120
$ decremented = $ this ->ensureAppIsSet ($ appId )
121
- ->__call ( ' hincrby ' , [ $ this ->getHash ($ appId ), 'current_connection_count ' , -1 ] );
121
+ ->hincrby ( $ this ->getHash ($ appId ), 'current_connection_count ' , -1 );
122
122
123
123
$ decremented ->then (function ($ currentConnectionCount ) use ($ appId ) {
124
124
// Get the peak connections count from Redis.
125
125
$ peakConnectionCount = $ this ->replicator
126
126
->getPublishClient ()
127
- ->__call ( ' hget ' , [ $ this ->getHash ($ appId ), 'peak_connection_count ' ] );
127
+ ->hget ( $ this ->getHash ($ appId ), 'peak_connection_count ' );
128
128
129
129
$ peakConnectionCount ->then (function ($ currentPeakConnectionCount ) use ($ currentConnectionCount , $ appId ) {
130
130
// Extract the greatest number between the current peak connection count
@@ -137,7 +137,7 @@ public function disconnection($appId)
137
137
// Then set it to the database.
138
138
$ this ->replicator
139
139
->getPublishClient ()
140
- ->__call ( ' hset ' , [ $ this ->getHash ($ appId ), 'peak_connection_count ' , $ peakConnectionCount] );
140
+ ->hset ( $ this ->getHash ($ appId ), 'peak_connection_count ' , $ peakConnectionCount );
141
141
});
142
142
});
143
143
}
@@ -152,13 +152,13 @@ public function save()
152
152
$ this ->lock ()->get (function () {
153
153
$ setMembers = $ this ->replicator
154
154
->getPublishClient ()
155
- ->__call ( ' smembers ' , [ ' laravel-websockets:apps '] );
155
+ ->smembers ( ' laravel-websockets:apps ' );
156
156
157
157
$ setMembers ->then (function ($ members ) {
158
158
foreach ($ members as $ appId ) {
159
159
$ member = $ this ->replicator
160
160
->getPublishClient ()
161
- ->__call ( ' hgetall ' , [ $ this ->getHash ($ appId )] );
161
+ ->hgetall ( $ this ->getHash ($ appId ));
162
162
163
163
$ member ->then (function ($ statistic ) use ($ appId ) {
164
164
if (! $ statistic ) {
@@ -201,7 +201,7 @@ protected function ensureAppIsSet($appId)
201
201
{
202
202
$ this ->replicator
203
203
->getPublishClient ()
204
- ->__call ( ' sadd ' , [ ' laravel-websockets:apps ' , $ appId] );
204
+ ->sadd ( ' laravel-websockets:apps ' , $ appId );
205
205
206
206
return $ this ->replicator ->getPublishClient ();
207
207
}
@@ -217,19 +217,19 @@ public function resetStatistics($appId, int $currentConnectionCount)
217
217
{
218
218
$ this ->replicator
219
219
->getPublishClient ()
220
- ->__call ( ' hset ' , [ $ this ->getHash ($ appId ), 'current_connection_count ' , $ currentConnectionCount] );
220
+ ->hset ( $ this ->getHash ($ appId ), 'current_connection_count ' , $ currentConnectionCount );
221
221
222
222
$ this ->replicator
223
223
->getPublishClient ()
224
- ->__call ( ' hset ' , [ $ this ->getHash ($ appId ), 'peak_connection_count ' , $ currentConnectionCount] );
224
+ ->hset ( $ this ->getHash ($ appId ), 'peak_connection_count ' , $ currentConnectionCount );
225
225
226
226
$ this ->replicator
227
227
->getPublishClient ()
228
- ->__call ( ' hset ' , [ $ this ->getHash ($ appId ), 'websocket_message_count ' , 0 ] );
228
+ ->hset ( $ this ->getHash ($ appId ), 'websocket_message_count ' , 0 );
229
229
230
230
$ this ->replicator
231
231
->getPublishClient ()
232
- ->__call ( ' hset ' , [ $ this ->getHash ($ appId ), 'api_message_count ' , 0 ] );
232
+ ->hset ( $ this ->getHash ($ appId ), 'api_message_count ' , 0 );
233
233
}
234
234
235
235
/**
@@ -243,23 +243,23 @@ public function resetAppTraces($appId)
243
243
{
244
244
$ this ->replicator
245
245
->getPublishClient ()
246
- ->__call ( ' hdel ' , [ $ this ->getHash ($ appId ), 'current_connection_count ' ] );
246
+ ->hdel ( $ this ->getHash ($ appId ), 'current_connection_count ' );
247
247
248
248
$ this ->replicator
249
249
->getPublishClient ()
250
- ->__call ( ' hdel ' , [ $ this ->getHash ($ appId ), 'peak_connection_count ' ] );
250
+ ->hdel ( $ this ->getHash ($ appId ), 'peak_connection_count ' );
251
251
252
252
$ this ->replicator
253
253
->getPublishClient ()
254
- ->__call ( ' hdel ' , [ $ this ->getHash ($ appId ), 'websocket_message_count ' ] );
254
+ ->hdel ( $ this ->getHash ($ appId ), 'websocket_message_count ' );
255
255
256
256
$ this ->replicator
257
257
->getPublishClient ()
258
- ->__call ( ' hdel ' , [ $ this ->getHash ($ appId ), 'api_message_count ' ] );
258
+ ->hdel ( $ this ->getHash ($ appId ), 'api_message_count ' );
259
259
260
260
$ this ->replicator
261
261
->getPublishClient ()
262
- ->__call ( ' srem ' , [ ' laravel-websockets:apps ' , $ appId] );
262
+ ->srem ( ' laravel-websockets:apps ' , $ appId );
263
263
}
264
264
265
265
/**
0 commit comments