Completed
Pull Request — master (#10)
by Andreas
02:41
created
lib/Mongo/MongoDBRef.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
      */
78 78
     public static function get($db, $ref)
79 79
     {
80
-        if (! static::isRef($ref)) {
80
+        if (!static::isRef($ref)) {
81 81
             return null;
82 82
         }
83 83
 
Please login to merge, or discard this patch.
lib/Alcaeus/MongoDbAdapter/AbstractCursor.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
     protected $readPreference = [];
73 73
 
74 74
     /**
75
-     * @return Cursor
75
+     * @return \Traversable
76 76
      */
77 77
     abstract protected function ensureCursor();
78 78
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             \MongoClient::RP_SECONDARY_PREFERRED,
217 217
             \MongoClient::RP_NEAREST
218 218
         ];
219
-        if (! in_array($readPreference, $availableReadPreferences)) {
219
+        if (!in_array($readPreference, $availableReadPreferences)) {
220 220
             trigger_error("The value '$readPreference' is not valid as read preference type", E_WARNING);
221 221
             return $this;
222 222
         }
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
             }
358 358
 
359 359
             $iterationInfo += [
360
-                'id' => (string)$this->cursor->getId(),
360
+                'id' => (string) $this->cursor->getId(),
361 361
                 'at' => null, // @todo Complete info for cursor that is iterating
362 362
                 'numReturned' => null, // @todo Complete info for cursor that is iterating
363 363
                 'server' => null, // @todo Complete info for cursor that is iterating
Please login to merge, or discard this patch.
lib/Mongo/MongoCursor.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@
 block discarded – undo
201 201
      * @link http://www.php.net/manual/en/mongocursor.hasnext.php
202 202
      * @throws MongoConnectionException
203 203
      * @throws MongoCursorTimeoutException
204
-     * @return bool Returns true if there is another element
204
+     * @return boolean|null Returns true if there is another element
205 205
      */
206 206
     public function hasNext()
207 207
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -377,7 +377,7 @@
 block discarded – undo
377 377
      */
378 378
     protected function convertCursorType()
379 379
     {
380
-        if (! $this->tailable) {
380
+        if (!$this->tailable) {
381 381
             return null;
382 382
         }
383 383
 
Please login to merge, or discard this patch.
lib/Mongo/MongoCollection.php 2 patches
Doc Comments   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -100,7 +100,6 @@  discard block
 block discarded – undo
100 100
      * @link http://www.php.net/manual/en/mongocollection.aggregate.php
101 101
      * @param array $pipeline
102 102
      * @param array $op
103
-     * @param array $pipelineOperators
104 103
      * @return array
105 104
      */
106 105
     public function aggregate(array $pipeline, array $op = [] /* , array $pipelineOperators, ... */)
@@ -170,7 +169,7 @@  discard block
 block discarded – undo
170 169
 
171 170
     /**
172 171
      * @link http://www.php.net/manual/en/mongocollection.getslaveokay.php
173
-     * @return bool
172
+     * @return boolean|null
174 173
      */
175 174
     public function getSlaveOkay()
176 175
     {
@@ -180,7 +179,7 @@  discard block
 block discarded – undo
180 179
     /**
181 180
      * @link http://www.php.net/manual/en/mongocollection.setslaveokay.php
182 181
      * @param bool $ok
183
-     * @return bool
182
+     * @return boolean|null
184 183
      */
185 184
     public function setSlaveOkay($ok = true)
186 185
     {
@@ -199,7 +198,7 @@  discard block
 block discarded – undo
199 198
     /**
200 199
      * @param string $read_preference
201 200
      * @param array $tags
202
-     * @return bool
201
+     * @return boolean|null
203 202
      */
204 203
     public function setReadPreference($read_preference, array $tags)
205 204
     {
@@ -235,7 +234,7 @@  discard block
 block discarded – undo
235 234
      * @throws MongoException if the inserted document is empty or if it contains zero-length keys. Attempting to insert an object with protected and private properties will cause a zero-length key error.
236 235
      * @throws MongoCursorException if the "w" option is set and the write fails.
237 236
      * @throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds.
238
-     * @return bool|array Returns an array containing the status of the insertion if the "w" option is set.
237
+     * @return MongoDB\InsertOneResult Returns an array containing the status of the insertion if the "w" option is set.
239 238
      */
240 239
     public function insert($a, array $options = array())
241 240
     {
@@ -248,7 +247,7 @@  discard block
 block discarded – undo
248 247
      * @param array $a An array of arrays.
249 248
      * @param array $options Options for the inserts.
250 249
      * @throws MongoCursorException
251
-     * @return mixed f "safe" is set, returns an associative array with the status of the inserts ("ok") and any error that may have occured ("err"). Otherwise, returns TRUE if the batch insert was successfully sent, FALSE otherwise.
250
+     * @return MongoDB\InsertManyResult f "safe" is set, returns an associative array with the status of the inserts ("ok") and any error that may have occured ("err"). Otherwise, returns TRUE if the batch insert was successfully sent, FALSE otherwise.
252 251
      */
253 252
     public function batchInsert(array $a, array $options = array())
254 253
     {
@@ -413,7 +412,7 @@  discard block
 block discarded – undo
413 412
      * @link http://www.php.net/manual/en/mongocollection.ensureindex.php
414 413
      * @param array $keys Field or fields to use as index.
415 414
      * @param array $options [optional] This parameter is an associative array of the form array("optionname" => <boolean>, ...).
416
-     * @return boolean always true
415
+     * @return boolean|null always true
417 416
      */
418 417
     public function ensureIndex(array $keys, array $options = array()) {}
419 418
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function aggregate(array $pipeline, array $op = [] /* , array $pipelineOperators, ... */)
107 107
     {
108
-        if (! TypeConverter::isNumericArray($pipeline)) {
108
+        if (!TypeConverter::isNumericArray($pipeline)) {
109 109
             $pipeline = [];
110 110
             $options = [];
111 111
 
112 112
             $i = 0;
113 113
             foreach (func_get_args() as $operator) {
114 114
                 $i++;
115
-                if (! is_array($operator)) {
115
+                if (!is_array($operator)) {
116 116
                     trigger_error("Argument $i is not an array", E_WARNING);
117 117
                     return;
118 118
                 }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         ];
149 149
 
150 150
         // Convert cursor option
151
-        if (! isset($options['cursor']) || $options['cursor'] === true || $options['cursor'] === []) {
151
+        if (!isset($options['cursor']) || $options['cursor'] === true || $options['cursor'] === []) {
152 152
             // Cursor option needs to be an object convert bools and empty arrays since those won't be handled by TypeConverter
153 153
             $options['cursor'] = new \stdClass;
154 154
         }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      * @throws MongoCursorException
285 285
      * @return boolean
286 286
      */
287
-    public function update(array $criteria , array $newobj, array $options = array())
287
+    public function update(array $criteria, array $newobj, array $options = array())
288 288
     {
289 289
         $multiple = ($options['multiple']) ? $options['multiple'] : false;
290 290
 //        $multiple = $options['multiple'] ?? false;
Please login to merge, or discard this patch.