@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function getFocusWidthAndHeight(int $width, int $height, string $ratio):array |
62 | 62 | { |
63 | - $width = (int) $width; |
|
64 | - $height = (int) $height; |
|
63 | + $width = (int)$width; |
|
64 | + $height = (int)$height; |
|
65 | 65 | $ratio = $this->getRatio($ratio); |
66 | 66 | $widthDiff = $width / $ratio[0]; |
67 | 67 | $heightDiff = $height / $ratio[1]; |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | if ($widthDiff < $heightDiff) { |
70 | 70 | return [ |
71 | 71 | $width, |
72 | - (int) ceil($widthDiff / $heightDiff * $height), |
|
72 | + (int)ceil($widthDiff / $heightDiff * $height), |
|
73 | 73 | ]; |
74 | 74 | } elseif ($widthDiff > $heightDiff) { |
75 | 75 | return [ |
76 | - (int) ceil($heightDiff / $widthDiff * $width), |
|
76 | + (int)ceil($heightDiff / $widthDiff * $width), |
|
77 | 77 | $height, |
78 | 78 | ]; |
79 | 79 | } |
@@ -131,12 +131,12 @@ discard block |
||
131 | 131 | protected function getShiftedFocusAreaPosition(int $length, int $focusLength, int $focusPosition, bool $invertScala = false):array |
132 | 132 | { |
133 | 133 | $halfWidth = $length / 2; |
134 | - $pixelPosition = (int) floor($halfWidth * $focusPosition / 100 + $halfWidth); |
|
134 | + $pixelPosition = (int)floor($halfWidth * $focusPosition / 100 + $halfWidth); |
|
135 | 135 | if ($invertScala) { |
136 | 136 | $pixelPosition = $length - $pixelPosition; |
137 | 137 | } |
138 | - $crop1 = (int) ($pixelPosition - floor($focusLength / 2)); |
|
139 | - $crop2 = (int) ($crop1 + $focusLength); |
|
138 | + $crop1 = (int)($pixelPosition - floor($focusLength / 2)); |
|
139 | + $crop2 = (int)($crop1 + $focusLength); |
|
140 | 140 | if ($crop1 < 0) { |
141 | 141 | $crop1 -= $crop1; |
142 | 142 | } elseif ($crop2 > $length) { |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | |
194 | 194 | $newFocusX = ($newRealFocusX - $newHalfWidth) * 100 / ($newHalfWidth); |
195 | 195 | $newFocusY = ($newHalfHeight - $newRealFocusY) * 100 / ($newHalfHeight); |
196 | - $newFocusX = (int) round($newFocusX, 0); |
|
197 | - $newFocusY = (int) round($newFocusY, 0); |
|
196 | + $newFocusX = (int)round($newFocusX, 0); |
|
197 | + $newFocusY = (int)round($newFocusY, 0); |
|
198 | 198 | |
199 | 199 | return [$newFocusX, $newFocusY]; |
200 | 200 | } |
@@ -217,12 +217,12 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | return [ |
220 | - MathUtility::canBeInterpretedAsInteger($ratio[0]) ? (int) $ratio[0] : (float) str_replace( |
|
220 | + MathUtility::canBeInterpretedAsInteger($ratio[0]) ? (int)$ratio[0] : (float)str_replace( |
|
221 | 221 | ',', |
222 | 222 | '.', |
223 | 223 | $ratio[0] |
224 | 224 | ), |
225 | - MathUtility::canBeInterpretedAsInteger($ratio[1]) ? (int) $ratio[1] : (float) str_replace( |
|
225 | + MathUtility::canBeInterpretedAsInteger($ratio[1]) ? (int)$ratio[1] : (float)str_replace( |
|
226 | 226 | ',', |
227 | 227 | '.', |
228 | 228 | $ratio[1] |