Completed
Push — master ( 831a39...87acb3 )
by Andreas
04:32
created
lib/Mongo/MongoGridFSFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
             $filename = 'file';
76 76
         }
77 77
 
78
-        if (! $handle = fopen($filename, 'w')) {
78
+        if ( ! $handle = fopen($filename, 'w')) {
79 79
             trigger_error(E_ERROR, 'Can not open the destination file');
80 80
             return 0;
81 81
         }
Please login to merge, or discard this patch.
lib/Mongo/MongoGridFS.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
             ];
232 232
 
233 233
             $handle = fopen($filename, 'r');
234
-            if (! $handle) {
234
+            if ( ! $handle) {
235 235
                 throw new MongoGridFSException('could not open file: ' . $filename);
236 236
             }
237
-        } elseif (! is_resource($filename)) {
237
+        } elseif ( ! is_resource($filename)) {
238 238
             throw new \Exception('first argument must be a string or stream resource');
239 239
         } else {
240 240
             $handle = $filename;
@@ -245,10 +245,10 @@  discard block
 block discarded – undo
245 245
 
246 246
         // Add length and MD5 if they were not present before
247 247
         $update = [];
248
-        if (! isset($record['length'])) {
248
+        if ( ! isset($record['length'])) {
249 249
             $update['length'] = $length;
250 250
         }
251
-        if (! isset($record['md5'])) {
251
+        if ( ! isset($record['md5'])) {
252 252
             $update['md5'] = $this->getMd5ForFile($file['_id']);
253 253
         }
254 254
 
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
      */
271 271
     public function storeUpload($name, array $metadata = [])
272 272
     {
273
-        if (! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) {
273
+        if ( ! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) {
274 274
             throw new MongoGridFSException("Could not find uploaded file $name");
275 275
         }
276
-        if (! isset($_FILES[$name]['tmp_name'])) {
276
+        if ( ! isset($_FILES[$name]['tmp_name'])) {
277 277
             throw new MongoGridFSException("Couldn't find tmp_name in the \$_FILES array. Are you sure the upload worked?");
278 278
         }
279 279
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         $chunkSize = $record['chunkSize'];
356 356
 
357 357
         rewind($handle);
358
-        while (! feof($handle)) {
358
+        while ( ! feof($handle)) {
359 359
             $data = stream_get_contents($handle, $chunkSize);
360 360
             $this->insertChunk($fileId, $data, $i++);
361 361
             $written += strlen($data);
Please login to merge, or discard this patch.