@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | |
135 | 135 | return $this->prepareWatermark( |
136 | 136 | $watermark, |
137 | - (int)((($this->getWidth() - $watermark->getWidth()) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
138 | - (int)((($this->getHeight() - $watermark->getHeight()) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'] |
|
137 | + (int) ((($this->getWidth() - $watermark->getWidth()) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
138 | + (int) ((($this->getHeight() - $watermark->getHeight()) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'] |
|
139 | 139 | ); |
140 | 140 | } |
141 | 141 | |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | $newWidth = $width; |
159 | 159 | |
160 | 160 | $this->getWidth() / $this->getHeight() >= $width / $height |
161 | - ? $newWidth = (int)($this->getWidth() / ($this->getHeight() / $height)) |
|
162 | - : $newHeight = (int)($this->getHeight() / ($this->getWidth() / $width)); |
|
161 | + ? $newWidth = (int) ($this->getWidth() / ($this->getHeight() / $height)) |
|
162 | + : $newHeight = (int) ($this->getHeight() / ($this->getWidth() / $width)); |
|
163 | 163 | |
164 | 164 | return $this->prepareThumbnail($width, $height, $newWidth, $newHeight); |
165 | 165 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function getBase64(): string |
178 | 178 | { |
179 | - return base64_encode((string)$this); |
|
179 | + return base64_encode((string) $this); |
|
180 | 180 | |
181 | 181 | } |
182 | 182 |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | imagecopymerge( |
78 | 78 | $this->getImage(), |
79 | 79 | $image = $this->prepareImage($text, $font), |
80 | - (int)((($this->getWidth() - imagesx($image)) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
81 | - (int)((($this->getHeight() - imagesy($image)) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'], |
|
80 | + (int) ((($this->getWidth() - imagesx($image)) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
81 | + (int) ((($this->getHeight() - imagesy($image)) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'], |
|
82 | 82 | 0, |
83 | 83 | 0, |
84 | 84 | $this->getWidth(), |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $maxX = max([$coordinates[0], $coordinates[2], $coordinates[4], $coordinates[6]]); |
107 | 107 | $minY = min([$coordinates[1], $coordinates[3], $coordinates[5], $coordinates[7]]); |
108 | 108 | $maxY = max([$coordinates[1], $coordinates[3], $coordinates[5], $coordinates[7]]); |
109 | - $textX = (int)abs($minX) + 1; |
|
110 | - $textY = (int)abs($minY) + 1; |
|
109 | + $textX = (int) abs($minX) + 1; |
|
110 | + $textY = (int) abs($minY) + 1; |
|
111 | 111 | $image = $this->newImage($maxX - $minX + 2, $maxY - $minY + 2); |
112 | 112 | imagecolortransparent($image, $white = imagecolorallocate($image, 0, 0, 0)); |
113 | 113 | imagefilledrectangle($image, 0, 0, $this->getWidth(), 20, $white); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function save(string $filename, $quality = 100): bool |
226 | 226 | { |
227 | - return imagepng($this->getImage(), $filename . '.png', (int)($quality / 11), PNG_ALL_FILTERS); |
|
227 | + return imagepng($this->getImage(), $filename . '.png', (int) ($quality / 11), PNG_ALL_FILTERS); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -243,8 +243,8 @@ discard block |
||
243 | 243 | imagecopyresampled( |
244 | 244 | $newimage = $this->newImage($width, $height), |
245 | 245 | $this->getImage(), |
246 | - 0 - (int)(($newWidth - $width) / 2), |
|
247 | - 0 - (int)(($newHeight - $height) / 2), |
|
246 | + 0 - (int) (($newWidth - $width) / 2), |
|
247 | + 0 - (int) (($newHeight - $height) / 2), |
|
248 | 248 | 0, |
249 | 249 | 0, |
250 | 250 | $newWidth, |
@@ -295,8 +295,8 @@ discard block |
||
295 | 295 | $y, |
296 | 296 | 0, |
297 | 297 | 0, |
298 | - $width = (int)$watermark->getWidth(), |
|
299 | - $height = (int)$watermark->getHeight(), |
|
298 | + $width = (int) $watermark->getWidth(), |
|
299 | + $height = (int) $watermark->getHeight(), |
|
300 | 300 | $width, |
301 | 301 | $height |
302 | 302 | ); |