@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * |
| 160 | 160 | * @param mixed $offset |
| 161 | 161 | * |
| 162 | - * @return bool|mixed |
|
| 162 | + * @return string|boolean |
|
| 163 | 163 | */ |
| 164 | 164 | public function offsetGet($offset) |
| 165 | 165 | {
|
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | /** |
| 360 | 360 | * Returns error string or false if no errors occurred |
| 361 | 361 | * |
| 362 | - * @return string|bool |
|
| 362 | + * @return string|false |
|
| 363 | 363 | */ |
| 364 | 364 | public function getError() |
| 365 | 365 | {
|
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | * Final upload method to be called, isolated for testing purposes |
| 461 | 461 | * |
| 462 | 462 | * @param $tmp_name int the temporary location of the image file |
| 463 | - * @param $destination int upload destination |
|
| 463 | + * @param string $destination int upload destination |
|
| 464 | 464 | * |
| 465 | 465 | * @return bool |
| 466 | 466 | */ |
@@ -229,9 +229,9 @@ discard block |
||
| 229 | 229 | public function setLocation($dir = "bulletproof", $permission = 0666) |
| 230 | 230 | {
|
| 231 | 231 | if (!file_exists($dir) && !is_dir($dir) && !$this->location) {
|
| 232 | - $createFolder = @mkdir("" . $dir, (int)$permission, true);
|
|
| 232 | + $createFolder = @mkdir("".$dir, (int) $permission, true);
|
|
| 233 | 233 | if (!$createFolder) {
|
| 234 | - $this->error = "Error! Folder " . $dir . " could not be created"; |
|
| 234 | + $this->error = "Error! Folder ".$dir." could not be created"; |
|
| 235 | 235 | return false; |
| 236 | 236 | } |
| 237 | 237 | } |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | public function getName() |
| 263 | 263 | {
|
| 264 | 264 | if (!$this->name) {
|
| 265 | - return uniqid(true) . "_" . str_shuffle(implode(range("e", "q")));
|
|
| 265 | + return uniqid(true)."_".str_shuffle(implode(range("e", "q")));
|
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | return $this->name; |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | */ |
| 276 | 276 | public function getFullPath() |
| 277 | 277 | {
|
| 278 | - $this->fullPath = $this->location . "/" . $this->name . "." . $this->mime; |
|
| 278 | + $this->fullPath = $this->location."/".$this->name.".".$this->mime; |
|
| 279 | 279 | return $this->fullPath; |
| 280 | 280 | } |
| 281 | 281 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | public function getSize() |
| 288 | 288 | {
|
| 289 | - return (int)$this->_files["size"]; |
|
| 289 | + return (int) $this->_files["size"]; |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /** |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | /* check image size based on the settings */ |
| 415 | 415 | if ($files["size"] < $minSize || $files["size"] > $maxSize) {
|
| 416 | 416 | $min = intval($minSize / 1000) ?: 1; |
| 417 | - $image->error = "Image size should be at least more than " . $min . " kb"; |
|
| 417 | + $image->error = "Image size should be at least more than ".$min." kb"; |
|
| 418 | 418 | return null; |
| 419 | 419 | } |
| 420 | 420 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | list($allowedWidth, $allowedHeight) = $image->dimensions; |
| 423 | 423 | |
| 424 | 424 | if ($image->height > $allowedHeight || $image->width > $allowedWidth) {
|
| 425 | - $image->error = "Image height/width should be less than " . $allowedHeight . "/" . $allowedWidth . " pixels"; |
|
| 425 | + $image->error = "Image height/width should be less than ".$allowedHeight."/".$allowedWidth." pixels"; |
|
| 426 | 426 | return null; |
| 427 | 427 | } |
| 428 | 428 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /* set and get folder name */ |
| 435 | - $image->fullPath = $image->location . "/" . $image->name . "." . $image->mime; |
|
| 435 | + $image->fullPath = $image->location."/".$image->name.".".$image->mime; |
|
| 436 | 436 | |
| 437 | 437 | /* gather image info for json storage */ |
| 438 | 438 | $image->serialize = array( |