1 | <?php |
||
15 | class MongodbQueue implements QueueInterface { |
||
16 | |||
17 | /** |
||
18 | * The queue storage. |
||
19 | * |
||
20 | * @var \MongoDB\Database |
||
21 | */ |
||
22 | protected $database; |
||
23 | |||
24 | /** |
||
25 | * The collection name for the queue. |
||
26 | * |
||
27 | * @var \MongoDB\Collection[] $collection |
||
28 | */ |
||
29 | protected $collection; |
||
30 | |||
31 | /** |
||
32 | * Constructs a \Drupal\mongodb\Queue\MongodbQueue object. |
||
33 | * |
||
34 | * @param string $name |
||
35 | * The name of the queue. |
||
36 | * @param array $settings |
||
37 | * Array of Mongodb-related settings for this queue. |
||
38 | * @param \MongoDB\Database $database |
||
39 | * The database object. |
||
40 | */ |
||
41 | public function __construct($name, $settings, Database $database) { |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function createItem($data) { |
||
61 | |||
62 | /** |
||
63 | * Adds a queue item and store it directly to the queue. |
||
64 | * |
||
65 | * @param $data |
||
66 | * Arbitrary data to be associated with the new task in the queue. |
||
67 | * |
||
68 | * @return |
||
69 | * A unique ID if the item was successfully created and was (best effort) |
||
70 | * added to the queue, otherwise FALSE. We don't guarantee the item was |
||
71 | * committed to disk etc, but as far as we know, the item is now in the |
||
72 | * queue. |
||
73 | */ |
||
74 | protected function doCreateItem($data) { |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function numberOfItems() { |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function claimItem($lease_time = 30) { |
||
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | public function releaseItem($item) { |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function deleteItem($item) { |
||
150 | |||
151 | /** |
||
152 | * {@inheritdoc} |
||
153 | */ |
||
154 | public function createQueue() { |
||
161 | |||
162 | /** |
||
163 | * {@inheritdoc} |
||
164 | */ |
||
165 | public function deleteQueue() { |
||
173 | |||
174 | } |
||
175 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..