@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | /** |
| 13 | 13 | * @var string Path to resources folder. |
| 14 | 14 | */ |
| 15 | - const RESOURCES_PATH = __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'resources'. DIRECTORY_SEPARATOR; |
|
| 15 | + const RESOURCES_PATH = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Build the real path from all given folders, with a trailing /. |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | return false; |
| 29 | 29 | } |
| 30 | 30 | foreach ($args as $arg) { |
| 31 | - $out .= rtrim(rtrim($arg, '/'), '\\') . DIRECTORY_SEPARATOR; |
|
| 31 | + $out .= rtrim(rtrim($arg, '/'), '\\').DIRECTORY_SEPARATOR; |
|
| 32 | 32 | } |
| 33 | 33 | $out = realpath($out); |
| 34 | - return $out !== false ? $out . DIRECTORY_SEPARATOR : false; |
|
| 34 | + return $out !== false ? $out.DIRECTORY_SEPARATOR : false; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public static function rmdir($path) |
| 45 | 45 | { |
| 46 | - if (empty($path) || $path == '/' || ! self::getPath($path)) { |
|
| 46 | + if (empty($path) || $path == '/' || !self::getPath($path)) { |
|
| 47 | 47 | return false; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public static function generateThumbnail($imageStr, $target, $maxWidth, $maxHeight, $crop = false) |
| 34 | 34 | { |
| 35 | - if (! touch($target)) { |
|
| 35 | + if (!touch($target)) { |
|
| 36 | 36 | throw new ImageConvertException('Target file is not writable.'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if ($crop && ($maxWidth == 0 || $maxHeight == 0)) { |
|
| 39 | + if ($crop && ($maxWidth == 0 || $maxHeight == 0)) { |
|
| 40 | 40 | throw new ImageConvertException('Both width and height must be provided for cropping'); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | throw new ImageConvertException('Could not generate the thumbnail from source image.'); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if (! imagecopyresized( |
|
| 70 | + if (!imagecopyresized( |
|
| 71 | 71 | $targetImg, $sourceImg, |
| 72 | 72 | 0, 0, 0, 0, |
| 73 | 73 | $finalWidth, $finalHeight, $originalWidth, $originalHeight |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $diffHeight = !empty($maxHeight) ? $originalHeight - $maxHeight : false; |
| 102 | 102 | |
| 103 | 103 | if (($diffHeight === false && $diffWidth !== false) |
| 104 | - || ($diffWidth > $diffHeight && ! $crop) |
|
| 104 | + || ($diffWidth > $diffHeight && !$crop) |
|
| 105 | 105 | || ($diffWidth < $diffHeight && $crop) |
| 106 | 106 | ) { |
| 107 | 107 | $finalWidth = $maxWidth; |