@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | * array offset \ArrayAccess |
127 | 127 | * unused |
128 | 128 | */ |
129 | - public function offsetSet($offset, $value){} |
|
130 | - public function offsetExists($offset){} |
|
131 | - public function offsetUnset($offset){} |
|
129 | + public function offsetSet($offset, $value) {} |
|
130 | + public function offsetExists($offset) {} |
|
131 | + public function offsetUnset($offset) {} |
|
132 | 132 | |
133 | 133 | /** |
134 | 134 | * Gets array value \ArrayAccess |
@@ -205,9 +205,9 @@ discard block |
||
205 | 205 | public function setLocation($dir = "bulletproof", $permission = 0666) |
206 | 206 | { |
207 | 207 | if (!file_exists($dir) && !is_dir($dir) && !$this->location) { |
208 | - $createFolder = @mkdir("" . $dir, (int) $permission, true); |
|
208 | + $createFolder = @mkdir("".$dir, (int) $permission, true); |
|
209 | 209 | if (!$createFolder) { |
210 | - $this->error = "Folder " . $dir . " could not be created"; |
|
210 | + $this->error = "Folder ".$dir." could not be created"; |
|
211 | 211 | return null; |
212 | 212 | } |
213 | 213 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | public function getName() |
239 | 239 | { |
240 | 240 | if (!$this->name) { |
241 | - return uniqid(true) . "_" . str_shuffle(implode(range("e", "q"))); |
|
241 | + return uniqid(true)."_".str_shuffle(implode(range("e", "q"))); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | return $this->name; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function getFullPath() |
253 | 253 | { |
254 | - $this->fullPath = $this->location . "/" . $this->name . "." . $this->mime; |
|
254 | + $this->fullPath = $this->location."/".$this->name.".".$this->mime; |
|
255 | 255 | return $this->fullPath; |
256 | 256 | } |
257 | 257 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function getLocation() |
304 | 304 | { |
305 | - if(!$this->location){ |
|
305 | + if (!$this->location) { |
|
306 | 306 | $this->setLocation(); |
307 | 307 | } |
308 | 308 | |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | * |
335 | 335 | * @return string|bool |
336 | 336 | */ |
337 | - public function getError(){ |
|
337 | + public function getError() { |
|
338 | 338 | return $this->error; |
339 | 339 | } |
340 | 340 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | list($minSize, $maxSize) = $image->size; |
381 | 381 | |
382 | 382 | /* check for common upload errors */ |
383 | - if($image->error = $image->uploadErrors($files["error"])){ |
|
383 | + if ($image->error = $image->uploadErrors($files["error"])) { |
|
384 | 384 | return false; |
385 | 385 | } |
386 | 386 | |
@@ -410,13 +410,13 @@ discard block |
||
410 | 410 | return false; |
411 | 411 | } |
412 | 412 | |
413 | - if($image->height < 4 || $image->width < 4){ |
|
413 | + if ($image->height < 4 || $image->width < 4) { |
|
414 | 414 | $image->error = Image::IMAGE_ERR_RESOLUTION_TOO_SMALL; |
415 | 415 | return false; |
416 | 416 | } |
417 | 417 | |
418 | 418 | /* set and get folder name */ |
419 | - $image->fullPath = $image->location. "/" . $image->name . "." . $image->mime; |
|
419 | + $image->fullPath = $image->location."/".$image->name.".".$image->mime; |
|
420 | 420 | |
421 | 421 | /* gather image info for json storage */ |
422 | 422 | $image->serialize = array( |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | namespace Bulletproof; |
11 | 11 | |
12 | - function crop($image, $mimeType, $imgWidth, $imgHeight, $newWidth, $newHeight){ |
|
12 | + function crop($image, $mimeType, $imgWidth, $imgHeight, $newWidth, $newHeight) { |
|
13 | 13 | |
14 | 14 | switch ($mimeType) { |
15 | 15 | case "jpg": |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | // Can't crop to a bigger size, ex: |
38 | 38 | // an image with 100X100 can not be cropped to 200X200. Image can only be cropped to smaller size. |
39 | 39 | if ($widthTrim < 0 && $heightTrim < 0) { |
40 | - return ; |
|
40 | + return; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $temp = imagecreatetruecolor($newWidth, $newHeight); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | */ |
10 | 10 | namespace Bulletproof; |
11 | 11 | |
12 | -function resize($image, $mimeType, $imgWidth, $imgHeight, $newWidth, $newHeight, $ratio = FALSE, $upsize = TRUE){ |
|
12 | +function resize($image, $mimeType, $imgWidth, $imgHeight, $newWidth, $newHeight, $ratio = FALSE, $upsize = TRUE) { |
|
13 | 13 | |
14 | 14 | // First, calculate the height. |
15 | 15 | $height = intval($newWidth / $imgWidth * $imgHeight); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | */ |
10 | 10 | namespace Bulletproof; |
11 | 11 | |
12 | - function watermark($image, $mimeType, $imgWidth, $imgHeight, $watermark, $watermarkHeight, $watermarkWidth, $position = "center"){ |
|
12 | + function watermark($image, $mimeType, $imgWidth, $imgHeight, $watermark, $watermarkHeight, $watermarkWidth, $position = "center") { |
|
13 | 13 | |
14 | 14 | // Calculate the watermark position |
15 | 15 | switch ($position) { |