Completed
Pull Request — master (#28)
by Andreas
03:41
created
lib/Mongo/MongoWriteConcernException.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,11 +17,14 @@
 block discarded – undo
17 17
  * <p>(PECL mongo &gt;= 1.5.0)</p>
18 18
  * @link http://php.net/manual/en/class.mongowriteconcernexception.php#class.mongowriteconcernexception
19 19
  */
20
-class MongoWriteConcernException extends MongoCursorException {
20
+class MongoWriteConcernException extends MongoCursorException
21
+{
21 22
     /**
22 23
      * Get the error document
23 24
      * @link http://php.net/manual/en/mongowriteconcernexception.getdocument.php
24 25
      * @return array <p>A MongoDB document, if available, as an array.</p>
25 26
      */
26
-    public function getDocument() {}
27
+    public function getDocument()
28
+    {
29
+}
27 30
 }
Please login to merge, or discard this patch.
lib/Mongo/MongoPool.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      *
36 36
      * @link http://php.net/manual/en/mongopool.setsize.php
37 37
      * @param int $size
38
-     * @return boolean Returns the former value of pool size
38
+     * @return integer Returns the former value of pool size
39 39
      */
40 40
     public static function setSize($size)
41 41
     {
Please login to merge, or discard this patch.
lib/Mongo/MongoLog.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
      * <ul>
120 120
      * @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.
121 121
      */
122
-    public static function setCallback(callable $log_function )
122
+    public static function setCallback(callable $log_function)
123 123
     {
124 124
         self::$callback = $log_function;
125 125
         return true;
Please login to merge, or discard this patch.
lib/Mongo/MongoGridFS.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
             ];
242 242
 
243 243
             $handle = fopen($filename, 'r');
244
-            if (! $handle) {
244
+            if ( ! $handle) {
245 245
                 throw new MongoGridFSException('could not open file: ' . $filename);
246 246
             }
247
-        } elseif (! is_resource($filename)) {
247
+        } elseif ( ! is_resource($filename)) {
248 248
             throw new \Exception('first argument must be a string or stream resource');
249 249
         } else {
250 250
             $handle = $filename;
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
 
267 267
         // Add length and MD5 if they were not present before
268 268
         $update = [];
269
-        if (! isset($record['length'])) {
269
+        if ( ! isset($record['length'])) {
270 270
             $update['length'] = $length;
271 271
         }
272
-        if (! isset($record['md5'])) {
272
+        if ( ! isset($record['md5'])) {
273 273
             try {
274 274
                 $update['md5'] = $this->getMd5ForFile($file['_id']);
275 275
             } catch (MongoException $e) {
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         if (count($update)) {
281 281
             try {
282 282
                 $result = $this->update(['_id' => $file['_id']], ['$set' => $update]);
283
-                if (! $this->isOKResult($result)) {
283
+                if ( ! $this->isOKResult($result)) {
284 284
                     throw new MongoGridFSException('Error updating file record');
285 285
                 }
286 286
             } catch (MongoException $e) {
@@ -304,10 +304,10 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public function storeUpload($name, array $metadata = [])
306 306
     {
307
-        if (! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) {
307
+        if ( ! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) {
308 308
             throw new MongoGridFSException("Could not find uploaded file $name");
309 309
         }
310
-        if (! isset($_FILES[$name]['tmp_name'])) {
310
+        if ( ! isset($_FILES[$name]['tmp_name'])) {
311 311
             throw new MongoGridFSException("Couldn't find tmp_name in the \$_FILES array. Are you sure the upload worked?");
312 312
         }
313 313
 
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 
358 358
         $result = $this->chunks->insert($chunk);
359 359
 
360
-        if (! $this->isOKResult($result)) {
360
+        if ( ! $this->isOKResult($result)) {
361 361
             throw new \MongoException('error inserting chunk');
362 362
         }
363 363
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
         $chunkSize = $record['chunkSize'];
400 400
 
401 401
         rewind($handle);
402
-        while (! feof($handle)) {
402
+        while ( ! feof($handle)) {
403 403
             $data = stream_get_contents($handle, $chunkSize);
404 404
             $this->insertChunk($fileId, $data, $i++);
405 405
             $written += strlen($data);
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 
427 427
         $result = $this->insert($record, $options);
428 428
 
429
-        if (! $this->isOKResult($result)) {
429
+        if ( ! $this->isOKResult($result)) {
430 430
             throw new \MongoException('error inserting file');
431 431
         }
432 432
 
Please login to merge, or discard this patch.
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,6 @@
 block discarded – undo
106 106
      * @link http://php.net/manual/en/mongogridfs.find.php
107 107
      * @param array $query The query
108 108
      * @param array $fields Fields to return
109
-     * @param array $options Options for the find command
110 109
      * @return MongoGridFSCursor A MongoGridFSCursor
111 110
      */
112 111
     public function find(array $query = [], array $fields = [])
Please login to merge, or discard this patch.
lib/Mongo/MongoGridFSCursor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,6 +65,6 @@
 block discarded – undo
65 65
     public function key()
66 66
     {
67 67
         $file = $this->current();
68
-        return ($file !== null) ? (string)$file->file['_id'] : null;
68
+        return ($file !== null) ? (string) $file->file['_id'] : null;
69 69
     }
70 70
 }
Please login to merge, or discard this patch.
lib/Mongo/MongoWriteBatch.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     public function add($item)
77 77
     {
78 78
         if (is_object($item)) {
79
-            $item = (array)$item;
79
+            $item = (array) $item;
80 80
         }
81 81
 
82 82
         $this->validate($item);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     final public function execute(array $writeOptions = [])
96 96
     {
97 97
         $writeOptions += $this->writeOptions;
98
-        if (! count($this->items)) {
98
+        if ( ! count($this->items)) {
99 99
             return ['ok' => true];
100 100
         }
101 101
 
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
     {
143 143
         switch ($this->batchType) {
144 144
             case self::COMMAND_UPDATE:
145
-                if (! isset($item['q']) || ! isset($item['u'])) {
145
+                if ( ! isset($item['q']) || ! isset($item['u'])) {
146 146
                     throw new Exception('invalid item');
147 147
                 }
148 148
                 break;
149 149
 
150 150
             case self::COMMAND_DELETE:
151
-                if (! isset($item['q']) || ! isset($item['limit'])) {
151
+                if ( ! isset($item['q']) || ! isset($item['limit'])) {
152 152
                     throw new Exception('invalid item');
153 153
                 }
154 154
                 break;
Please login to merge, or discard this patch.
lib/Alcaeus/MongoDbAdapter/Helper/WriteConcernConverter.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.
lib/Mongo/functions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 use Alcaeus\MongoDbAdapter\TypeConverter;
17 17
 
18
-if (! function_exists('bson_decode')) {
18
+if ( ! function_exists('bson_decode')) {
19 19
     /**
20 20
      * Deserializes a BSON object into a PHP array
21 21
      *
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     }
29 29
 }
30 30
 
31
-if (! function_exists('bson_encode')) {
31
+if ( ! function_exists('bson_encode')) {
32 32
     /**
33 33
      * Serializes a PHP variable into a BSON string
34 34
      *
Please login to merge, or discard this patch.