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
@@ 190-196 (lines=7) @@
187
            $totalQuery['earliestGet'] = [$key => new UTCDateTime((int)(microtime(true) * 1000))];
188
        }
189
190
        foreach ($query as $key => $value) {
191
            if (!is_string($key)) {
192
                throw new \InvalidArgumentException('key in $query was not a string');
193
            }
194
195
            $totalQuery["payload.{$key}"] = $value;
196
        }
197
198
        return $this->collection->count($totalQuery);
199
    }