@@ -113,21 +113,21 @@ discard block |
||
113 | 113 | * @param mixed $offset |
114 | 114 | * @param mixed $value |
115 | 115 | */ |
116 | - public function offsetSet($offset, $value){} |
|
116 | + public function offsetSet($offset, $value) {} |
|
117 | 117 | |
118 | 118 | /** |
119 | 119 | * \ArrayAccess unused method |
120 | 120 | * |
121 | 121 | * @param mixed $offset |
122 | 122 | */ |
123 | - public function offsetExists($offset){} |
|
123 | + public function offsetExists($offset) {} |
|
124 | 124 | |
125 | 125 | /** |
126 | 126 | * \ArrayAccess unused method |
127 | 127 | * |
128 | 128 | * @param mixed $offset |
129 | 129 | */ |
130 | - public function offsetUnset($offset){} |
|
130 | + public function offsetUnset($offset) {} |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * \ArrayAccess - get array value from object |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function getPath() |
179 | 179 | { |
180 | - return $this->path = $this->getStorage() . '/' . $this->getName() . '.' . $this->getMime(); |
|
180 | + return $this->path = $this->getStorage().'/'.$this->getName().'.'.$this->getMime(); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -299,8 +299,8 @@ discard block |
||
299 | 299 | { |
300 | 300 | if ($isNameProvided) { |
301 | 301 | $this->name = filter_var($isNameProvided, FILTER_SANITIZE_STRING); |
302 | - }else{ |
|
303 | - $this->name = uniqid('', true) . '_' . str_shuffle(implode(range('e', 'q'))); |
|
302 | + } else { |
|
303 | + $this->name = uniqid('', true).'_'.str_shuffle(implode(range('e', 'q'))); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | return $this; |
@@ -382,10 +382,10 @@ discard block |
||
382 | 382 | return false; |
383 | 383 | } |
384 | 384 | |
385 | - $create = !is_dir($dir) ? @mkdir('' . $dir, (int) $permission, true) : true; |
|
385 | + $create = !is_dir($dir) ? @mkdir(''.$dir, (int) $permission, true) : true; |
|
386 | 386 | |
387 | 387 | if (!$create) { |
388 | - $this->error = 'Error! directory \'' . $dir . '\' could not be created'; |
|
388 | + $this->error = 'Error! directory \''.$dir.'\' could not be created'; |
|
389 | 389 | return false; |
390 | 390 | } |
391 | 391 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | public function validateMime() { |
399 | 399 | $this->getImageMime($this->_files['tmp_name']); |
400 | 400 | |
401 | - if(!in_array($this->mime, $this->mimeTypes)) { |
|
401 | + if (!in_array($this->mime, $this->mimeTypes)) { |
|
402 | 402 | $this->error = sprintf('Invalid File! Only (%s) image types are allowed', implode(', ', $this->mimeTypes)); |
403 | 403 | return false; |
404 | 404 | } |
@@ -424,13 +424,13 @@ discard block |
||
424 | 424 | $this->width = $this->getWidth(); |
425 | 425 | $this->height = $this->getHeight(); |
426 | 426 | |
427 | - if($this->height > $maxHeight) { |
|
427 | + if ($this->height > $maxHeight) { |
|
428 | 428 | $this->error = sprintf('Image height should be smaller than (%s) pixels', $maxHeight); |
429 | 429 | |
430 | 430 | return false; |
431 | 431 | } |
432 | 432 | |
433 | - if($this->width > $maxWidth) { |
|
433 | + if ($this->width > $maxWidth) { |
|
434 | 434 | $this->error = sprintf('Image width should be smaller than (%s) pixels', $maxHeight); |
435 | 435 | |
436 | 436 | return false; |