@@ -110,19 +110,19 @@ discard block |
||
| 110 | 110 | * @param mixed $value |
| 111 | 111 | * @return null |
| 112 | 112 | */ |
| 113 | - public function offsetSet($offset, $value){}
|
|
| 113 | + public function offsetSet($offset, $value) {}
|
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * @param mixed $offset |
| 117 | 117 | * @return null |
| 118 | 118 | */ |
| 119 | - public function offsetExists($offset){}
|
|
| 119 | + public function offsetExists($offset) {}
|
|
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | * @param mixed $offset |
| 123 | 123 | * @return null |
| 124 | 124 | */ |
| 125 | - public function offsetUnset($offset){}
|
|
| 125 | + public function offsetUnset($offset) {}
|
|
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * Gets array value \ArrayAccess |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $this->_files = $this->_files[$offset]; |
| 147 | 147 | |
| 148 | 148 | // check for common upload errors |
| 149 | - if(isset($this->_files['error'])){
|
|
| 149 | + if (isset($this->_files['error'])) {
|
|
| 150 | 150 | $this->error = $this->commonUploadErrors[$this->_files['error']]; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | public function getFullPath() |
| 176 | 176 | {
|
| 177 | - $this->fullPath = $this->location . '/' . $this->name . '.' . $this->mime; |
|
| 177 | + $this->fullPath = $this->location.'/'.$this->name.'.'.$this->mime; |
|
| 178 | 178 | return $this->fullPath; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | public function getJson() |
| 211 | 211 | {
|
| 212 | 212 | /* gather image info for json storage */ |
| 213 | - return json_encode ( |
|
| 213 | + return json_encode( |
|
| 214 | 214 | array( |
| 215 | 215 | 'name' => $this->name, |
| 216 | 216 | 'mime' => $this->mime, |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | public function getName() |
| 286 | 286 | {
|
| 287 | 287 | if (!$this->name) {
|
| 288 | - return uniqid('', true) . '_' . str_shuffle(implode(range('e', 'q')));
|
|
| 288 | + return uniqid('', true).'_'.str_shuffle(implode(range('e', 'q')));
|
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | return $this->name; |
@@ -361,8 +361,8 @@ discard block |
||
| 361 | 361 | {
|
| 362 | 362 | $isValid = file_exists($dir) || is_dir($dir) || !is_writable($dir); |
| 363 | 363 | |
| 364 | - if(!$isValid){
|
|
| 365 | - $this->error = 'Can not create a folder \'' . $dir . '\', please permission issues '; |
|
| 364 | + if (!$isValid) {
|
|
| 365 | + $this->error = 'Can not create a folder \''.$dir.'\', please permission issues '; |
|
| 366 | 366 | return false; |
| 367 | 367 | } |
| 368 | 368 | |
@@ -381,14 +381,14 @@ discard block |
||
| 381 | 381 | {
|
| 382 | 382 | $isDirectoryValid = $this->isDirectoryValid($dir); |
| 383 | 383 | |
| 384 | - if(!$isDirectoryValid){
|
|
| 384 | + if (!$isDirectoryValid) {
|
|
| 385 | 385 | return false; |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | - $create = @mkdir('' . $dir, (int) $permission, true);
|
|
| 388 | + $create = @mkdir(''.$dir, (int) $permission, true);
|
|
| 389 | 389 | |
| 390 | 390 | if (!$create) {
|
| 391 | - $this->error = 'Error! Folder ' . $dir . ' could not be created'; |
|
| 391 | + $this->error = 'Error! Folder '.$dir.' could not be created'; |
|
| 392 | 392 | return false; |
| 393 | 393 | } |
| 394 | 394 | |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | if ($files['size'] < $minSize || $files['size'] > $maxSize) {
|
| 435 | 435 | $min = intval($minSize / 1000) ?: 1; |
| 436 | 436 | $max = intval($maxSize / 1000) ?: 1; |
| 437 | - $image->error = 'Image size should be at least ' . $min . ' KB, and no more than ' . $max . ' KB'; |
|
| 437 | + $image->error = 'Image size should be at least '.$min.' KB, and no more than '.$max.' KB'; |
|
| 438 | 438 | return false; |
| 439 | 439 | } |
| 440 | 440 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | list($allowedWidth, $allowedHeight) = $image->dimensions; |
| 443 | 443 | |
| 444 | 444 | if ($image->height > $allowedHeight || $image->width > $allowedWidth) {
|
| 445 | - $image->error = 'Image height/width should be less than ' . $allowedHeight . '/' . $allowedWidth . ' pixels'; |
|
| 445 | + $image->error = 'Image height/width should be less than '.$allowedHeight.'/'.$allowedWidth.' pixels'; |
|
| 446 | 446 | return false; |
| 447 | 447 | } |
| 448 | 448 | |