Code Duplication    Length = 7-9 lines in 2 locations

src/Statistics/Logger/RedisStatisticsLogger.php 2 locations

@@ 156-162 (lines=7) @@
153
     * @param  int  $currentConnectionCount
154
     * @return void
155
     */
156
    public function resetStatistics($appId, int $currentConnectionCount)
157
    {
158
        $this->redis->hset($this->getHash($appId), 'current_connection_count', $currentConnectionCount);
159
        $this->redis->hset($this->getHash($appId), 'peak_connection_count', $currentConnectionCount);
160
        $this->redis->hset($this->getHash($appId), 'websocket_message_count', 0);
161
        $this->redis->hset($this->getHash($appId), 'api_message_count', 0);
162
    }
163
164
    /**
165
     * Remove all app traces from the database if no connections have been set
@@ 171-179 (lines=9) @@
168
     * @param  mixed  $appId
169
     * @return void
170
     */
171
    public function resetAppTraces($appId)
172
    {
173
        $this->redis->hdel($this->getHash($appId), 'current_connection_count');
174
        $this->redis->hdel($this->getHash($appId), 'peak_connection_count');
175
        $this->redis->hdel($this->getHash($appId), 'websocket_message_count');
176
        $this->redis->hdel($this->getHash($appId), 'api_message_count');
177
178
        $this->redis->srem('laravel-websockets:apps', $appId);
179
    }
180
181
    /**
182
     * Get the Redis hash name for the app.