@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Compolomus\Compomage; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Compolomus\Compomage\Interfaces; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Compolomus\Compomage; |
| 4 | 4 | |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | return $this->prepareWatermark( |
| 111 | 111 | $watermark, |
| 112 | - (int)((($this->getWidth() - $watermark->getWidth()) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
| 113 | - (int)((($this->getHeight() - $watermark->getHeight()) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'] |
|
| 112 | + (int) ((($this->getWidth() - $watermark->getWidth()) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
| 113 | + (int) ((($this->getHeight() - $watermark->getHeight()) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'] |
|
| 114 | 114 | ); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | $newWidth = $width; |
| 123 | 123 | |
| 124 | 124 | $this->getWidth() / $this->getHeight() >= $width / $height |
| 125 | - ? $newWidth = (int)($this->getWidth() / ($this->getHeight() / $height)) |
|
| 126 | - : $newHeight = (int)($this->getHeight() / ($this->getWidth() / $width)); |
|
| 125 | + ? $newWidth = (int) ($this->getWidth() / ($this->getHeight() / $height)) |
|
| 126 | + : $newHeight = (int) ($this->getHeight() / ($this->getWidth() / $width)); |
|
| 127 | 127 | |
| 128 | 128 | return $this->prepareThumbnail($width, $height, $newWidth, $newHeight); |
| 129 | 129 | } |
@@ -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 | |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | imagecopymerge( |
| 73 | 73 | $this->getImage(), |
| 74 | 74 | $image = $this->prepareImage($text, $font), |
| 75 | - (int)((($this->getWidth() - imagesx($image)) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
| 76 | - (int)((($this->getHeight() - imagesy($image)) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'], |
|
| 75 | + (int) ((($this->getWidth() - imagesx($image)) / 2) * self::POSITIONS[strtoupper($position)]['x']) + self::POSITIONS[strtoupper($position)]['padX'], |
|
| 76 | + (int) ((($this->getHeight() - imagesy($image)) / 2) * self::POSITIONS[strtoupper($position)]['y']) + self::POSITIONS[strtoupper($position)]['padY'], |
|
| 77 | 77 | 0, |
| 78 | 78 | 0, |
| 79 | 79 | $this->getWidth(), |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $maxX = max([$coordinates[0], $coordinates[2], $coordinates[4], $coordinates[6]]); |
| 102 | 102 | $minY = min([$coordinates[1], $coordinates[3], $coordinates[5], $coordinates[7]]); |
| 103 | 103 | $maxY = max([$coordinates[1], $coordinates[3], $coordinates[5], $coordinates[7]]); |
| 104 | - $textX = (int)abs($minX) + 1; |
|
| 105 | - $textY = (int)abs($minY) + 1; |
|
| 104 | + $textX = (int) abs($minX) + 1; |
|
| 105 | + $textY = (int) abs($minY) + 1; |
|
| 106 | 106 | $image = $this->newImage($maxX - $minX + 2, $maxY - $minY + 2); |
| 107 | 107 | imagecolortransparent($image, $white = imagecolorallocate($image, 0, 0, 0)); |
| 108 | 108 | imagefilledrectangle($image, 0, 0, $this->getWidth(), 20, $white); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function save(string $filename, $quality = 100): bool |
| 214 | 214 | { |
| 215 | - return imagepng($this->getImage(), $filename . '.png', (int)($quality / 11), PNG_ALL_FILTERS); |
|
| 215 | + return imagepng($this->getImage(), $filename . '.png', (int) ($quality / 11), PNG_ALL_FILTERS); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -231,8 +231,8 @@ discard block |
||
| 231 | 231 | imagecopyresampled( |
| 232 | 232 | $newimage = $this->newImage($width, $height), |
| 233 | 233 | $this->getImage(), |
| 234 | - 0 - (int)(($newWidth - $width) / 2), |
|
| 235 | - 0 - (int)(($newHeight - $height) / 2), |
|
| 234 | + 0 - (int) (($newWidth - $width) / 2), |
|
| 235 | + 0 - (int) (($newHeight - $height) / 2), |
|
| 236 | 236 | 0, |
| 237 | 237 | 0, |
| 238 | 238 | $newWidth, |
@@ -283,8 +283,8 @@ discard block |
||
| 283 | 283 | $y, |
| 284 | 284 | 0, |
| 285 | 285 | 0, |
| 286 | - $width = (int)$watermark->getWidth(), |
|
| 287 | - $height = (int)$watermark->getHeight(), |
|
| 286 | + $width = (int) $watermark->getWidth(), |
|
| 287 | + $height = (int) $watermark->getHeight(), |
|
| 288 | 288 | $width, |
| 289 | 289 | $height |
| 290 | 290 | ); |