Completed
Push — master ( 584b9a...7e12c0 )
by samayo
03:51 queued 02:07
created
src/bulletproof.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
             return $this->error;
168 168
         }
169 169
 
170
-        if(!isset($this->_files[$offset])){
171
-            return ;
170
+        if (!isset($this->_files[$offset])) {
171
+            return;
172 172
         }
173 173
 
174 174
         /* check for common upload errors */
175 175
         if ($this->_files[$offset]['error'] == 2) {
176 176
             $this->error = "Image is larger than specified by the browser";
177
-            return ;
177
+            return;
178 178
         }
179 179
 
180 180
         if ($this->error || $this->error = $this->commonUploadErrors($this->_files[$offset]['error'])) {
@@ -244,16 +244,16 @@  discard block
 block discarded – undo
244 244
     {
245 245
 
246 246
         if (!file_exists($dir) && !is_dir($dir) && !$this->location) {
247
-            $createFolder = @mkdir('' . $dir, (int)$permission, true);
247
+            $createFolder = @mkdir(''.$dir, (int) $permission, true);
248 248
             if (!$createFolder) {
249
-                $this->error = 'Error! Folder ' . $dir . ' could not be created';
249
+                $this->error = 'Error! Folder '.$dir.' could not be created';
250 250
                 return false;
251 251
             }
252 252
         }
253 253
         
254 254
         /* check if we can create a file in the directory */
255 255
         if (!is_writable($dir)) {
256
-            $this->error =  "The images directory \"" . $dir . "\" is not writable!";
256
+            $this->error = "The images directory \"".$dir."\" is not writable!";
257 257
             return false;
258 258
         }
259 259
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
     public function getName()
284 284
     {
285 285
         if (!$this->name) {
286
-            return uniqid('', true) . '_' . str_shuffle(implode(range('e', 'q')));
286
+            return uniqid('', true).'_'.str_shuffle(implode(range('e', 'q')));
287 287
         }
288 288
 
289 289
         return $this->name;
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      */
297 297
     public function getFullPath()
298 298
     {
299
-        $this->fullPath = $this->location . '/' . $this->name . '.' . $this->mime;
299
+        $this->fullPath = $this->location.'/'.$this->name.'.'.$this->mime;
300 300
         return $this->fullPath;
301 301
     }
302 302
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      */
308 308
     public function getSize()
309 309
     {
310
-        return (int)$this->_files['size'];
310
+        return (int) $this->_files['size'];
311 311
     }
312 312
 
313 313
     /**
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
         if ($files['size'] < $minSize || $files['size'] > $maxSize) {
434 434
             $min = intval($minSize / 1000) ?: 1;
435 435
             $max = intval($maxSize / 1000) ?: 1;
436
-            $image->error = "Image size should be at least " . $min . " KB, and no more than " . $max . " KB";
436
+            $image->error = "Image size should be at least ".$min." KB, and no more than ".$max." KB";
437 437
             return null;
438 438
         }
439 439
 
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
         list($allowedWidth, $allowedHeight) = $image->dimensions;
442 442
 
443 443
         if ($image->height > $allowedHeight || $image->width > $allowedWidth) {
444
-            $image->error = 'Image height/width should be less than ' . $allowedHeight . '/' . $allowedWidth . ' pixels';
444
+            $image->error = 'Image height/width should be less than '.$allowedHeight.'/'.$allowedWidth.' pixels';
445 445
             return false;
446 446
         }
447 447
 
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
         }
452 452
 
453 453
         /* set and get folder name */
454
-        $image->fullPath = $image->location . '/' . $image->name . '.' . $image->mime;
454
+        $image->fullPath = $image->location.'/'.$image->name.'.'.$image->mime;
455 455
 
456 456
         /* gather image info for json storage */
457 457
         $image->serialize = array(
Please login to merge, or discard this patch.