Completed
Pull Request — master (#15)
by
unknown
14:43
created
lib/Mongo/MongoGridFS.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function find(array $query = array(), array $fields = array())
93 93
     {
94
-        $cursor = new MongoGridFSCursor($this, $this->db->getConnection(), (string)$this, $query, $fields);
94
+        $cursor = new MongoGridFSCursor($this, $this->db->getConnection(), (string) $this, $query, $fields);
95 95
         $cursor->setReadPreference($this->getReadPreference());
96 96
 
97 97
         return $cursor;
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
             $shortName = basename($filename);
113 113
             $filename = fopen($filename, 'r');
114 114
         }
115
-        if (! is_resource($filename)) {
115
+        if ( ! is_resource($filename)) {
116 116
             throw new \InvalidArgumentException();
117 117
         }
118 118
         $length = fstat($filename)['size'];
119
-        $extra['chunkSize'] = isset($extra['chunkSize']) ? $extra['chunkSize']: self::DEFAULT_CHUNK_SIZE;
119
+        $extra['chunkSize'] = isset($extra['chunkSize']) ? $extra['chunkSize'] : self::DEFAULT_CHUNK_SIZE;
120 120
         $extra['_id'] = isset($extra['_id']) ?: new MongoId();
121 121
         $extra['length'] = $length;
122 122
         $extra['md5'] = isset($md5) ? $md5 : $this->calculateMD5($filename, $length);
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     public function findOne(array $query = array(), array $fields = array())
217 217
     {
218 218
         $file = parent::findOne($query, $fields);
219
-        if (! $file) {
219
+        if ( ! $file) {
220 220
             return;
221 221
         }
222 222
         return new MongoGridFSFile($this, $file);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         if (is_string($id)) {
253 253
             $id = new MongoId($id);
254 254
         }
255
-        if (! $id instanceof MongoId) {
255
+        if ( ! $id instanceof MongoId) {
256 256
             return false;
257 257
         }
258 258
         $this->chunks->remove(['file_id' => $id], ['justOne' => false]);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      */
269 269
     public function storeUpload($name, array $metadata = [])
270 270
     {
271
-        if (! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) {
271
+        if ( ! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) {
272 272
             throw new \InvalidArgumentException();
273 273
         }
274 274
         $metadata += ['filename' => $_FILES[$name]['name']];
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         if (is_string($id)) {
287 287
             $id = new MongoId($id);
288 288
         }
289
-        if (! $id instanceof MongoId) {
289
+        if ( ! $id instanceof MongoId) {
290 290
             return false;
291 291
         }
292 292
         return $this->findOne(['_id' => $id]);
Please login to merge, or discard this patch.
lib/Mongo/MongoGridFSFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
     private function writeFromRessource($handle)
130 130
     {
131 131
 
132
-        if (! $handle) {
132
+        if ( ! $handle) {
133 133
             trigger_error(E_ERROR, 'can not open the destination file');
134 134
         }
135 135
         $written = 0;
Please login to merge, or discard this patch.