Passed
Branch master (a17811)
by compolom
03:05 queued 01:14
created
src/AbstractImage.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/GD.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         );
Please login to merge, or discard this patch.