Completed
Pull Request — master (#8)
by
unknown
02:27
created
lib/Mongo/MongoCollection.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      * @throws MongoCursorException
246 246
      * @return boolean
247 247
      */
248
-    public function update(array $criteria , array $newobj, array $options = array())
248
+    public function update(array $criteria, array $newobj, array $options = array())
249 249
     {
250 250
         $multiple = ($options['multiple']) ? $options['multiple'] : false;
251 251
 //        $multiple = $options['multiple'] ?? false;
@@ -457,9 +457,9 @@  discard block
 block discarded – undo
457 457
     public function save($a, array $options = array())
458 458
     {
459 459
         if (is_object($a)) {
460
-            $a = (array)$a;
460
+            $a = (array) $a;
461 461
         }
462
-        if ( ! array_key_exists('_id', $a)) {
462
+        if (!array_key_exists('_id', $a)) {
463 463
             $a['_id'] = new \MongoId();
464 464
         }
465 465
         $filter = ['_id' => $a['_id']];
Please login to merge, or discard this patch.
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
     /**
133 133
      * @link http://www.php.net/manual/en/mongocollection.getslaveokay.php
134
-     * @return bool
134
+     * @return boolean|null
135 135
      */
136 136
     public function getSlaveOkay()
137 137
     {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     /**
142 142
      * @link http://www.php.net/manual/en/mongocollection.setslaveokay.php
143 143
      * @param bool $ok
144
-     * @return bool
144
+     * @return boolean|null
145 145
      */
146 146
     public function setSlaveOkay($ok = true)
147 147
     {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     /**
161 161
      * @param string $read_preference
162 162
      * @param array $tags
163
-     * @return bool
163
+     * @return boolean|null
164 164
      */
165 165
     public function setReadPreference($read_preference, array $tags)
166 166
     {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      * @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.
197 197
      * @throws MongoCursorException if the "w" option is set and the write fails.
198 198
      * @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.
199
-     * @return bool|array Returns an array containing the status of the insertion if the "w" option is set.
199
+     * @return MongoDB\InsertOneResult Returns an array containing the status of the insertion if the "w" option is set.
200 200
      */
201 201
     public function insert($a, array $options = array())
202 202
     {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      * @param array $a An array of arrays.
210 210
      * @param array $options Options for the inserts.
211 211
      * @throws MongoCursorException
212
-     * @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.
212
+     * @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.
213 213
      */
214 214
     public function batchInsert(array $a, array $options = array())
215 215
     {
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
      * @link http://www.php.net/manual/en/mongocollection.createindex.php
365 365
      * @param array $keys Field or fields to use as index.
366 366
      * @param array $options [optional] This parameter is an associative array of the form array("optionname" => <boolean>, ...).
367
-     * @return array Returns the database response.
367
+     * @return string|false Returns the database response.
368 368
      */
369 369
     public function createIndex(array $keys, array $options = array())
370 370
     {
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
      * @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.
452 452
      * @throws MongoCursorException if the "w" option is set and the write fails.
453 453
      * @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.
454
-     * @return array|boolean If w was set, returns an array containing the status of the save.
454
+     * @return MongoDB\InsertOneResult If w was set, returns an array containing the status of the save.
455 455
      * Otherwise, returns a boolean representing if the array was not empty (an empty array will not be inserted).
456 456
      */
457 457
     public function save($a, array $options = array())
Please login to merge, or discard this patch.