Completed
Pull Request — master (#13)
by Andreas
02:30
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 1 patch
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.
lib/Mongo/MongoCursor.php 3 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.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 
16 16
 use Alcaeus\MongoDbAdapter\AbstractCursor;
17 17
 use MongoDB\Driver\Cursor;
18
-use MongoDB\Driver\ReadPreference;
19 18
 use MongoDB\Operation\Find;
20 19
 
21 20
 /**
Please login to merge, or discard this patch.
lib/Mongo/MongoCollection.php 2 patches
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.
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
     /**
188 188
      * @link http://www.php.net/manual/en/mongocollection.getslaveokay.php
189
-     * @return bool
189
+     * @return boolean|null
190 190
      */
191 191
     public function getSlaveOkay()
192 192
     {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     /**
197 197
      * @link http://www.php.net/manual/en/mongocollection.setslaveokay.php
198 198
      * @param bool $ok
199
-     * @return bool
199
+     * @return boolean|null
200 200
      */
201 201
     public function setSlaveOkay($ok = true)
202 202
     {
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      * @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.
255 255
      * @throws MongoCursorException if the "w" option is set and the write fails.
256 256
      * @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.
257
-     * @return bool|array Returns an array containing the status of the insertion if the "w" option is set.
257
+     * @return MongoDB\InsertOneResult Returns an array containing the status of the insertion if the "w" option is set.
258 258
      */
259 259
     public function insert($a, array $options = array())
260 260
     {
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
      * @param array $a An array of arrays.
268 268
      * @param array $options Options for the inserts.
269 269
      * @throws MongoCursorException
270
-     * @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.
270
+     * @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.
271 271
      */
272 272
     public function batchInsert(array $a, array $options = array())
273 273
     {
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
      * @link http://www.php.net/manual/en/mongocollection.ensureindex.php
433 433
      * @param array $keys Field or fields to use as index.
434 434
      * @param array $options [optional] This parameter is an associative array of the form array("optionname" => <boolean>, ...).
435
-     * @return boolean always true
435
+     * @return boolean|null always true
436 436
      */
437 437
     public function ensureIndex(array $keys, array $options = array()) {}
438 438
 
Please login to merge, or discard this patch.
lib/Alcaeus/MongoDbAdapter/Helper/WriteConcern.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
      */
56 56
     protected function setWriteConcernFromParameters($wstring, $wtimeout = 0)
57 57
     {
58
-        if (! is_string($wstring) && ! is_int($wstring)) {
58
+        if (!is_string($wstring) && !is_int($wstring)) {
59 59
             trigger_error("w for WriteConcern must be a string or integer", E_WARNING);
60 60
             return false;
61 61
         }
Please login to merge, or discard this patch.