Completed
Pull Request — master (#13)
by Andreas
02:43
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
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.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function aggregate(array $pipeline, array $op = [])
123 123
     {
124
-        if (! TypeConverter::isNumericArray($pipeline)) {
124
+        if (!TypeConverter::isNumericArray($pipeline)) {
125 125
             $pipeline = [];
126 126
             $options = [];
127 127
 
128 128
             $i = 0;
129 129
             foreach (func_get_args() as $operator) {
130 130
                 $i++;
131
-                if (! is_array($operator)) {
131
+                if (!is_array($operator)) {
132 132
                     trigger_error("Argument $i is not an array", E_WARNING);
133 133
                     return;
134 134
                 }
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
         ];
165 165
 
166 166
         // Convert cursor option
167
-        if (! isset($options['cursor']) || $options['cursor'] === true || $options['cursor'] === []) {
167
+        if (!isset($options['cursor']) || $options['cursor'] === true || $options['cursor'] === []) {
168 168
             // Cursor option needs to be an object convert bools and empty arrays since those won't be handled by TypeConverter
169 169
             $options['cursor'] = new \stdClass;
170 170
         }
171 171
 
172 172
         $command += $options;
173 173
 
174
-        $cursor = new MongoCommandCursor($this->db->getConnection(), (string)$this, $command);
174
+        $cursor = new MongoCommandCursor($this->db->getConnection(), (string) $this, $command);
175 175
         $cursor->setReadPreference($this->getReadPreference());
176 176
 
177 177
         return $cursor;
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
      * @throws MongoCursorException
307 307
      * @return boolean
308 308
      */
309
-    public function update(array $criteria , array $newobj, array $options = array())
309
+    public function update(array $criteria, array $newobj, array $options = array())
310 310
     {
311 311
         $multiple = ($options['multiple']) ? $options['multiple'] : false;
312 312
 //        $multiple = $options['multiple'] ?? false;
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
      */
375 375
     public function find(array $query = array(), array $fields = array())
376 376
     {
377
-        $cursor = new MongoCursor($this->db->getConnection(), (string)$this, $query, $fields);
377
+        $cursor = new MongoCursor($this->db->getConnection(), (string) $this, $query, $fields);
378 378
         $cursor->setReadPreference($this->getReadPreference());
379 379
 
380 380
         return $cursor;
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.