Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class UnorderedQueue extends AbstractQueue implements QueueInterface |
||
15 | { |
||
16 | /** |
||
17 | * Override from AbstractQueue class to remove sort options. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | const FIND_ONE_AND_UPDATE_OPTIONS = [ |
||
22 | 'typeMap' => ['root' => 'array', 'document' => 'array', 'array' => 'array'], |
||
23 | 'returnDocument' => FindOneAndUpdate::RETURN_DOCUMENT_AFTER, |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * Construct queue. |
||
28 | * |
||
29 | * @param \MongoDB\Collection|string $collectionOrUrl A MongoCollection instance or the mongo connection url. |
||
30 | * @param string $db the mongo db name |
||
31 | * @param string $collection the collection name to use for the queue |
||
32 | * |
||
33 | * @throws \InvalidArgumentException $collectionOrUrl, $db or $collection was not a string |
||
34 | */ |
||
35 | public function __construct($collectionOrUrl, string $db = null, string $collection = null) |
||
49 |