Completed
Pull Request — master (#220)
by
unknown
03:07
created
lib/Mongo/MongoGridFS.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public function findOne($query = [], array $fields = [], array $options = [])
146 146
     {
147
-        if (! is_array($query)) {
147
+        if ( ! is_array($query)) {
148 148
             $query = ['filename' => (string) $query];
149 149
         }
150 150
 
@@ -239,15 +239,15 @@  discard block
 block discarded – undo
239 239
         $record = $extra;
240 240
         if (is_string($filename)) {
241 241
             $handle = fopen($filename, 'rb');
242
-            if (! $handle) {
242
+            if ( ! $handle) {
243 243
                 throw new MongoGridFSException('could not open file: ' . $filename);
244 244
             }
245
-        } elseif (! is_resource($filename)) {
245
+        } elseif ( ! is_resource($filename)) {
246 246
             throw new \Exception('first argument must be a string or stream resource');
247 247
         } else {
248 248
             $handle = $filename;
249 249
             $metadata = stream_get_meta_data($handle);
250
-            $filename =  $metadata['uri'];
250
+            $filename = $metadata['uri'];
251 251
         }
252 252
         $id = $this->bucket->uploadFromStream($filename, $handle);
253 253
         if (count($extra)) {
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
      */
270 270
     public function storeUpload($name, array $metadata = [])
271 271
     {
272
-        if (! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) {
272
+        if ( ! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) {
273 273
             throw new MongoGridFSException("Could not find uploaded file $name");
274 274
         }
275
-        if (! isset($_FILES[$name]['tmp_name'])) {
275
+        if ( ! isset($_FILES[$name]['tmp_name'])) {
276 276
             throw new MongoGridFSException("Couldn't find tmp_name in the \$_FILES array. Are you sure the upload worked?");
277 277
         }
278 278
 
Please login to merge, or discard this patch.