@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * |
| 153 | 153 | * @param mixed $offset |
| 154 | 154 | * |
| 155 | - * @return bool|mixed |
|
| 155 | + * @return string|boolean |
|
| 156 | 156 | */ |
| 157 | 157 | public function offsetGet($offset) |
| 158 | 158 | {
|
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | /** |
| 365 | 365 | * Returns error string or false if no errors occurred |
| 366 | 366 | * |
| 367 | - * @return string|bool |
|
| 367 | + * @return string|false |
|
| 368 | 368 | */ |
| 369 | 369 | public function getError(){
|
| 370 | 370 | return $this->error != "" ? $this->error : false; |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | * Final upload method to be called, isolated for testing purposes |
| 474 | 474 | * |
| 475 | 475 | * @param $tmp_name int the temporary location of the image file |
| 476 | - * @param $destination int upload destination |
|
| 476 | + * @param string $destination int upload destination |
|
| 477 | 477 | * |
| 478 | 478 | * @return bool |
| 479 | 479 | */ |
@@ -134,18 +134,18 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |