Code Duplication    Length = 7-7 lines in 2 locations

src/AbstractQueue.php 2 locations

@@ 113-119 (lines=7) @@
110
        }
111
112
        $completeQuery = ['earliestGet' => ['$lte' => new UTCDateTime((int)(microtime(true) * 1000))]];
113
        foreach ($query as $key => $value) {
114
            if (!is_string($key)) {
115
                throw new \InvalidArgumentException('key in $query was not a string');
116
            }
117
118
            $completeQuery["payload.{$key}"] = $value;
119
        }
120
121
        $resetTimestamp = time() + $runningResetDuration;
122
        //ints overflow to floats
@@ 195-201 (lines=7) @@
192
            $totalQuery['earliestGet'] = [$key => new UTCDateTime((int)(microtime(true) * 1000))];
193
        }
194
195
        foreach ($query as $key => $value) {
196
            if (!is_string($key)) {
197
                throw new \InvalidArgumentException('key in $query was not a string');
198
            }
199
200
            $totalQuery["payload.{$key}"] = $value;
201
        }
202
203
        return $this->collection->count($totalQuery);
204
    }