@@ -114,21 +114,21 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @return null |
116 | 116 | */ |
117 | - public function offsetSet($offset, $value){} |
|
117 | + public function offsetSet($offset, $value) {} |
|
118 | 118 | |
119 | 119 | /** |
120 | 120 | * @param mixed $offset |
121 | 121 | * |
122 | 122 | * @return null |
123 | 123 | */ |
124 | - public function offsetExists($offset){} |
|
124 | + public function offsetExists($offset) {} |
|
125 | 125 | |
126 | 126 | /** |
127 | 127 | * @param mixed $offset |
128 | 128 | * |
129 | 129 | * @return null |
130 | 130 | */ |
131 | - public function offsetUnset($offset){} |
|
131 | + public function offsetUnset($offset) {} |
|
132 | 132 | |
133 | 133 | /** |
134 | 134 | * Gets array value \ArrayAccess |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $this->_files = $this->_files[$offset]; |
153 | 153 | |
154 | 154 | // check for common upload errors |
155 | - if(isset($this->_files['error'])){ |
|
155 | + if (isset($this->_files['error'])) { |
|
156 | 156 | $this->error = $this->commonUploadErrors[$this->_files['error']]; |
157 | 157 | } |
158 | 158 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function getFullPath() |
182 | 182 | { |
183 | - return $this->fullPath = $this->getLocation() . '/' . $this->getName() . '.' . $this->getMime(); |
|
183 | + return $this->fullPath = $this->getLocation().'/'.$this->getName().'.'.$this->getMime(); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | public function getJson() |
216 | 216 | { |
217 | - return json_encode ( |
|
217 | + return json_encode( |
|
218 | 218 | array( |
219 | 219 | 'name' => $this->name, |
220 | 220 | 'mime' => $this->mime, |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function getMime() |
236 | 236 | { |
237 | - if(!$this->mime){ |
|
237 | + if (!$this->mime) { |
|
238 | 238 | $this->mime = $this->getImageMime($this->_files['tmp_name']); |
239 | 239 | } |
240 | 240 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | public function getName() |
290 | 290 | { |
291 | 291 | if (!$this->name) { |
292 | - $this->name = uniqid('', true) . '_' . str_shuffle(implode(range('e', 'q'))); |
|
292 | + $this->name = uniqid('', true).'_'.str_shuffle(implode(range('e', 'q'))); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | return $this->name; |
@@ -376,15 +376,15 @@ discard block |
||
376 | 376 | { |
377 | 377 | $isDirectoryValid = $this->isDirectoryValid($dir); |
378 | 378 | |
379 | - if(!$isDirectoryValid){ |
|
380 | - $this->error = 'Can not create a directory \'' . $dir . '\', please check your dir permission'; |
|
379 | + if (!$isDirectoryValid) { |
|
380 | + $this->error = 'Can not create a directory \''.$dir.'\', please check your dir permission'; |
|
381 | 381 | return false; |
382 | 382 | } |
383 | 383 | |
384 | - $create = !is_dir($dir) ? @mkdir('' . $dir, (int) $permission, true) : true; |
|
384 | + $create = !is_dir($dir) ? @mkdir(''.$dir, (int) $permission, true) : true; |
|
385 | 385 | |
386 | 386 | if (!$create) { |
387 | - $this->error = 'Error! directory \'' . $dir . '\' could not be created'; |
|
387 | + $this->error = 'Error! directory \''.$dir.'\' could not be created'; |
|
388 | 388 | return false; |
389 | 389 | } |
390 | 390 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | if ($files['size'] < $minSize || $files['size'] > $maxSize) { |
430 | 430 | $min = intval($minSize / 1000) ?: 1; |
431 | 431 | $max = intval($maxSize / 1000) ?: 1; |
432 | - $image->error = 'Image size should be at least ' . $min . ' KB, and no more than ' . $max . ' KB'; |
|
432 | + $image->error = 'Image size should be at least '.$min.' KB, and no more than '.$max.' KB'; |
|
433 | 433 | return false; |
434 | 434 | } |
435 | 435 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | list($allowedWidth, $allowedHeight) = $image->dimensions; |
438 | 438 | |
439 | 439 | if ($image->height > $allowedHeight || $image->width > $allowedWidth) { |
440 | - $image->error = 'Image height/width should be less than ' . $allowedHeight . '/' . $allowedWidth . ' pixels'; |
|
440 | + $image->error = 'Image height/width should be less than '.$allowedHeight.'/'.$allowedWidth.' pixels'; |
|
441 | 441 | return false; |
442 | 442 | } |
443 | 443 | |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | public function moveUploadedFile($tmp_name, $destination) |
462 | 462 | { |
463 | 463 | if ($image->error === '') { |
464 | - $moveUpload = move_uploaded_file($tmp_name, $destination);; |
|
464 | + $moveUpload = move_uploaded_file($tmp_name, $destination); ; |
|
465 | 465 | if (false !== $moveUpload) { |
466 | 466 | return $this; |
467 | 467 | } else { |