Code Duplication    Length = 7-7 lines in 2 locations

src/Queue.php 2 locations

@@ 156-162 (lines=7) @@
153
        }
154
155
        $completeQuery = ['resetTimestamp' => ['$lte' => new \MongoDate()]];
156
        foreach ($query as $key => $value) {
157
            if (!is_string($key)) {
158
                throw new \InvalidArgumentException('key in $query was not a string');
159
            }
160
161
            $completeQuery["payload.{$key}"] = $value;
162
        }
163
164
        $completeQuery['earliestGet'] = ['$lte' => new \MongoDate()];
165
@@ 233-239 (lines=7) @@
230
            $totalQuery['resetTimestamp'] = [$key => new \MongoDate()];
231
        }
232
233
        foreach ($query as $key => $value) {
234
            if (!is_string($key)) {
235
                throw new \InvalidArgumentException('key in $query was not a string');
236
            }
237
238
            $totalQuery["payload.{$key}"] = $value;
239
        }
240
241
        return $this->collection->count($totalQuery);
242
    }