Completed
Push — master ( ace230...37f7ca )
by samayo
01:56
created
src/bulletproof.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -134,18 +134,18 @@  discard block
 block discarded – undo
134 134
      * @param mixed $offset
135 135
      * @param mixed $value
136 136
      */
137
-    public function offsetSet($offset, $value){}
137
+    public function offsetSet($offset, $value) {}
138 138
 
139 139
     /**
140 140
      * @param mixed $offset
141 141
      * @return null
142 142
      */
143
-    public function offsetExists($offset){}
143
+    public function offsetExists($offset) {}
144 144
 
145 145
     /**
146 146
      * @param mixed $offset
147 147
      */
148
-    public function offsetUnset($offset){}
148
+    public function offsetUnset($offset) {}
149 149
 
150 150
     /**
151 151
      * Gets array value \ArrayAccess
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     public function setLocation($dir = "bulletproof", $permission = 0666)
223 223
     {
224 224
         if (!file_exists($dir) && !is_dir($dir) && !$this->location) {
225
-            $createFolder = @mkdir("" . $dir, (int) $permission, true);
225
+            $createFolder = @mkdir("".$dir, (int) $permission, true);
226 226
             if (!$createFolder) {
227 227
                 $this->error = sprintf($this->error_messages['location'], $dir);
228 228
                 return;
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	 */
257 257
 	public function setErrorMessages($new_error_messages)
258 258
 	{
259
-		if($new_array = array_replace_recursive($this->error_messages, $new_error_messages)) {
259
+		if ($new_array = array_replace_recursive($this->error_messages, $new_error_messages)) {
260 260
 			$this->error_messages = $new_array;
261 261
 		};
262 262
 		return $this;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     public function getName()
271 271
     {
272 272
         if (!$this->name) {
273
-           return  uniqid(true) . "_" . str_shuffle(implode(range("e", "q")));
273
+           return  uniqid(true)."_".str_shuffle(implode(range("e", "q")));
274 274
         }
275 275
 
276 276
         return $this->name;
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      */
284 284
     public function getFullPath()
285 285
     {
286
-        $this->fullPath = $this->location . "/" . $this->name . "." . $this->mime;
286
+        $this->fullPath = $this->location."/".$this->name.".".$this->mime;
287 287
         return $this->fullPath;
288 288
     }
289 289
 
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      */
335 335
     public function getLocation()
336 336
     {
337
-        if(!$this->location){
337
+        if (!$this->location) {
338 338
             $this->setLocation(); 
339 339
         }
340 340
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      *
367 367
      * @return string|bool
368 368
      */
369
-    public function getError(){
369
+    public function getError() {
370 370
         return $this->error != "" ? $this->error : false;
371 371
     }
372 372
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
         $files = $this->_files;
395 395
 
396 396
         /* check if php_exif is enabled */
397
-        if(!function_exists('exif_imagetype')){
397
+        if (!function_exists('exif_imagetype')) {
398 398
             $image->error = "Function 'exif_imagetype' Not found. Please enable \"php_exif\" in your PHP.ini";
399 399
             return null;
400 400
         }
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
         list($minSize, $maxSize) = $image->size;
410 410
 
411 411
         /* check for common upload errors */
412
-        if($image->error = $image->uploadErrors($files["error"])){
412
+        if ($image->error = $image->uploadErrors($files["error"])) {
413 413
             return null;
414 414
         }
415 415
 
@@ -439,13 +439,13 @@  discard block
 block discarded – undo
439 439
             return null;
440 440
         }
441 441
 
442
-        if($image->height < 4 || $image->width < 4){
442
+        if ($image->height < 4 || $image->width < 4) {
443 443
             $image->error = $this->error_messages['too_small'];
444 444
             return null;
445 445
         }
446 446
  
447 447
         /* set and get folder name */
448
-        $image->fullPath = $image->location. "/" . $image->name . "." . $image->mime;
448
+        $image->fullPath = $image->location."/".$image->name.".".$image->mime;
449 449
 
450 450
         /* gather image info for json storage */ 
451 451
         $image->serialize = array(
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
             }
466 466
         }
467 467
 
468
-        $image->error =  $this->error_messages['unknown'];
468
+        $image->error = $this->error_messages['unknown'];
469 469
         return false;
470 470
     }
471 471
 
Please login to merge, or discard this patch.