@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Compolomus\Compomage; |
| 4 | 4 | |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | imagecopymerge( |
| 72 | 72 | $this->getImage(), |
| 73 | 73 | $image = $this->prepareImage($text, $font), |
| 74 | - (int)((($this->getWidth() - imagesx($image)) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
| 75 | - (int)((($this->getHeight() - imagesy($image)) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'], |
|
| 74 | + (int) ((($this->getWidth() - imagesx($image)) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
| 75 | + (int) ((($this->getHeight() - imagesy($image)) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'], |
|
| 76 | 76 | 0, |
| 77 | 77 | 0, |
| 78 | 78 | $this->getWidth(), |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | $maxX = max([$coordinates[0], $coordinates[2], $coordinates[4], $coordinates[6]]); |
| 100 | 100 | $minY = min([$coordinates[1], $coordinates[3], $coordinates[5], $coordinates[7]]); |
| 101 | 101 | $maxY = max([$coordinates[1], $coordinates[3], $coordinates[5], $coordinates[7]]); |
| 102 | - $textX = (int)abs($minX) + 1; |
|
| 103 | - $textY = (int)abs($minY) + 1; |
|
| 102 | + $textX = (int) abs($minX) + 1; |
|
| 103 | + $textY = (int) abs($minY) + 1; |
|
| 104 | 104 | $image = $this->newImage($maxX - $minX + 2, $maxY - $minY + 2); |
| 105 | 105 | imagecolortransparent($image, $white = imagecolorallocate($image, 0, 0, 0)); |
| 106 | 106 | imagefilledrectangle($image, 0, 0, $this->getWidth(), 20, $white); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | public function save(string $filename, $quality = 100): bool |
| 183 | 183 | { |
| 184 | - return imagepng($this->getImage(), $filename . '.png', (int)($quality / 11), PNG_ALL_FILTERS); |
|
| 184 | + return imagepng($this->getImage(), $filename . '.png', (int) ($quality / 11), PNG_ALL_FILTERS); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | protected function prepareThumbnail( |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | imagecopyresampled( |
| 194 | 194 | $newimage = $this->newImage($width, $height), |
| 195 | 195 | $this->getImage(), |
| 196 | - 0 - (int)(($newWidth - $width) / 2), |
|
| 197 | - 0 - (int)(($newHeight - $height) / 2), |
|
| 196 | + 0 - (int) (($newWidth - $width) / 2), |
|
| 197 | + 0 - (int) (($newHeight - $height) / 2), |
|
| 198 | 198 | 0, |
| 199 | 199 | 0, |
| 200 | 200 | $newWidth, |
@@ -245,8 +245,8 @@ discard block |
||
| 245 | 245 | $y, |
| 246 | 246 | 0, |
| 247 | 247 | 0, |
| 248 | - $width = (int)$watermark->getWidth(), |
|
| 249 | - $height = (int)$watermark->getHeight(), |
|
| 248 | + $width = (int) $watermark->getWidth(), |
|
| 249 | + $height = (int) $watermark->getHeight(), |
|
| 250 | 250 | $width, |
| 251 | 251 | $height |
| 252 | 252 | ); |