@@ -37,7 +37,7 @@ |
||
37 | 37 | public function __construct(ImageResizerService $imageResizerService, array $options = []) |
38 | 38 | { |
39 | 39 | $this->setOptions(array_merge($this->options, $options)) |
40 | - ->setImageResizerService($imageResizerService); |
|
40 | + ->setImageResizerService($imageResizerService); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -119,13 +119,13 @@ |
||
119 | 119 | |
120 | 120 | // Prep this model |
121 | 121 | $this->setPath($path) |
122 | - ->setSplFileInfo(new SplFileInfo($path)) |
|
123 | - ->setOriginalWidth($width) |
|
124 | - ->setOriginalHeight($height) |
|
125 | - ->setTargetWidth($targetWidth) |
|
126 | - ->setTargetHeight($targetHeight) |
|
127 | - ->calculateCropPositions($cropMode, $x, $y) |
|
128 | - ->setTargetPath($this->generateFileName()); |
|
122 | + ->setSplFileInfo(new SplFileInfo($path)) |
|
123 | + ->setOriginalWidth($width) |
|
124 | + ->setOriginalHeight($height) |
|
125 | + ->setTargetWidth($targetWidth) |
|
126 | + ->setTargetHeight($targetHeight) |
|
127 | + ->calculateCropPositions($cropMode, $x, $y) |
|
128 | + ->setTargetPath($this->generateFileName()); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -140,7 +140,7 @@ |
||
140 | 140 | // Get the filepath |
141 | 141 | $explodedFilepath = explode(DIRECTORY_SEPARATOR, $this->getPath()); |
142 | 142 | // Reconstruct the base file path |
143 | - $baseFilepath = implode(DIRECTORY_SEPARATOR, array_slice($explodedFilepath, 0, count($explodedFilepath)-1)); |
|
143 | + $baseFilepath = implode(DIRECTORY_SEPARATOR, array_slice($explodedFilepath, 0, count($explodedFilepath) - 1)); |
|
144 | 144 | // Explode the filename |
145 | 145 | $explodedFilename = explode('.', $filename); |
146 | 146 | // Generate new name |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function scaleThumbnail(string $filepath, int $targetWidth = 0, int $targetHeight = 0) |
196 | 196 | { |
197 | - if (!file_exists($filepath) && is_file($filepath)) { |
|
197 | + if ( ! file_exists($filepath) && is_file($filepath)) { |
|
198 | 198 | throw new InvalidArgumentException('File does not exist!'); |
199 | 199 | } |
200 | 200 | |
201 | - if ($targetHeight >! 0 || $targetWidth >! 0) { |
|
201 | + if ($targetHeight > ! 0 || $targetWidth > ! 0) { |
|
202 | 202 | throw new InvalidArgumentException('targetWidth or targetHeight needs to be defined.'); |
203 | 203 | } |
204 | 204 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | // Get the filepath |
213 | 213 | $explodedFilepath = explode(DIRECTORY_SEPARATOR, $filepath); |
214 | 214 | // Reconstruct the base file path |
215 | - $baseFilepath = implode(DIRECTORY_SEPARATOR, array_slice($explodedFilepath, 0, count($explodedFilepath)-1)); |
|
215 | + $baseFilepath = implode(DIRECTORY_SEPARATOR, array_slice($explodedFilepath, 0, count($explodedFilepath) - 1)); |
|
216 | 216 | // Explode the filename |
217 | 217 | $explodedFilename = explode('.', $filename); |
218 | 218 | // Generate new name |
@@ -21,7 +21,7 @@ |
||
21 | 21 | $objects = []; |
22 | 22 | |
23 | 23 | foreach ($this::RESIZEABLES as $resizable) { |
24 | - if (!property_exists($this, $resizable)) { |
|
24 | + if ( ! property_exists($this, $resizable)) { |
|
25 | 25 | continue; |
26 | 26 | } |
27 | 27 |