Code Duplication    Length = 7-7 lines in 2 locations

src/Queue.php 2 locations

@@ 161-167 (lines=7) @@
158
        }
159
160
        $completeQuery = ['earliestGet' => ['$lte' => new UTCDateTime((int)(microtime(true) * 1000))]];
161
        foreach ($query as $key => $value) {
162
            if (!is_string($key)) {
163
                throw new \InvalidArgumentException('key in $query was not a string');
164
            }
165
166
            $completeQuery["payload.{$key}"] = $value;
167
        }
168
169
        $resetTimestamp = time() + $runningResetDuration;
170
        //ints overflow to floats
@@ 253-259 (lines=7) @@
250
            $totalQuery['earliestGet'] = [$key => new UTCDateTime((int)(microtime(true) * 1000))];
251
        }
252
253
        foreach ($query as $key => $value) {
254
            if (!is_string($key)) {
255
                throw new \InvalidArgumentException('key in $query was not a string');
256
            }
257
258
            $totalQuery["payload.{$key}"] = $value;
259
        }
260
261
        return $this->collection->count($totalQuery);
262
    }