@@ -57,7 +57,7 @@ |
||
57 | 57 | { |
58 | 58 | $table = 'tx_focuspoint_domain_model_dimension'; |
59 | 59 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); |
60 | - return (array) $queryBuilder->select('*') |
|
60 | + return (array)$queryBuilder->select('*') |
|
61 | 61 | ->from($table) |
62 | 62 | ->execute() |
63 | 63 | ->fetchAll(); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $sysFileMatadataRepository = GeneralUtility::makeInstance(SysFileMetadataRepository::class); |
88 | 88 | $row = $sysFileMatadataRepository->findByFileUid((int)$fileUid); |
89 | 89 | if ($row) { |
90 | - $sysFileMatadataRepository->updateByUid((int) $row['uid'], $values); |
|
90 | + $sysFileMatadataRepository->updateByUid((int)$row['uid'], $values); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | $p = $parameter['P']; |
106 | 106 | if (isset($p['referenceUid']) && MathUtility::canBeInterpretedAsInteger($p['referenceUid'])) { |
107 | - return (int) $p['referenceUid']; |
|
107 | + return (int)$p['referenceUid']; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | return null; |
@@ -79,7 +79,7 @@ |
||
79 | 79 | $connection->update( |
80 | 80 | self::TABLE, |
81 | 81 | $values, |
82 | - ['uid' => (int) $rows[0]['uid']] |
|
82 | + ['uid' => (int)$rows[0]['uid']] |
|
83 | 83 | ); |
84 | 84 | } else { |
85 | 85 | $connection->insert( |
@@ -84,8 +84,8 @@ |
||
84 | 84 | protected function cleanupPosition(array $position):array |
85 | 85 | { |
86 | 86 | return [ |
87 | - MathUtility::forceIntegerInRange((int) $position[0], -100, 100, 0), |
|
88 | - MathUtility::forceIntegerInRange((int) $position[1], -100, 100, 0), |
|
87 | + MathUtility::forceIntegerInRange((int)$position[0], -100, 100, 0), |
|
88 | + MathUtility::forceIntegerInRange((int)$position[1], -100, 100, 0), |
|
89 | 89 | ]; |
90 | 90 | } |
91 | 91 | } |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | } |
147 | 147 | $docRoot = rtrim(GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT'), '/') . '/'; |
148 | 148 | $relativeSrc = str_replace($docRoot, '', $absoluteImageName); |
149 | - $focusPointX = MathUtility::forceIntegerInRange((int) $x, -100, 100, 0); |
|
150 | - $focusPointY = MathUtility::forceIntegerInRange((int) $y, -100, 100, 0); |
|
149 | + $focusPointX = MathUtility::forceIntegerInRange((int)$x, -100, 100, 0); |
|
150 | + $focusPointY = MathUtility::forceIntegerInRange((int)$y, -100, 100, 0); |
|
151 | 151 | |
152 | 152 | if (0 === $focusPointX && 0 === $focusPointY) { |
153 | 153 | $table = Group::TABLE; |
154 | 154 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); |
155 | - $rows = (array) $queryBuilder->select('uid', 'focus_point_x', 'focus_point_y') |
|
155 | + $rows = (array)$queryBuilder->select('uid', 'focus_point_x', 'focus_point_y') |
|
156 | 156 | ->from($table) |
157 | 157 | ->where( |
158 | 158 | $queryBuilder->expr()->eq('relative_file_path', $queryBuilder->createNamedParameter($relativeSrc)) |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | ->fetchAll(); |
162 | 162 | |
163 | 163 | if (!empty($rows)) { |
164 | - $focusPointX = MathUtility::forceIntegerInRange((int) $rows[0]['focus_point_x'], -100, 100, 0); |
|
165 | - $focusPointY = MathUtility::forceIntegerInRange((int) $rows[0]['focus_point_y'], -100, 100, 0); |
|
164 | + $focusPointX = MathUtility::forceIntegerInRange((int)$rows[0]['focus_point_x'], -100, 100, 0); |
|
165 | + $focusPointY = MathUtility::forceIntegerInRange((int)$rows[0]['focus_point_y'], -100, 100, 0); |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function getFocusWidthAndHeight(int $width, int $height, string $ratio):array |
63 | 63 | { |
64 | - $width = (int) $width; |
|
65 | - $height = (int) $height; |
|
64 | + $width = (int)$width; |
|
65 | + $height = (int)$height; |
|
66 | 66 | $ratio = $this->getRatio($ratio); |
67 | 67 | $widthDiff = $width / $ratio[0]; |
68 | 68 | $heightDiff = $height / $ratio[1]; |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | if ($widthDiff < $heightDiff) { |
71 | 71 | return [ |
72 | 72 | $width, |
73 | - (int) ceil($widthDiff / $heightDiff * $height), |
|
73 | + (int)ceil($widthDiff / $heightDiff * $height), |
|
74 | 74 | ]; |
75 | 75 | } elseif ($widthDiff > $heightDiff) { |
76 | 76 | return [ |
77 | - (int) ceil($heightDiff / $widthDiff * $width), |
|
77 | + (int)ceil($heightDiff / $widthDiff * $width), |
|
78 | 78 | $height, |
79 | 79 | ]; |
80 | 80 | } |
@@ -132,12 +132,12 @@ discard block |
||
132 | 132 | protected function getShiftedFocusAreaPosition(int $length, int $focusLength, int $focusPosition, bool $invertScala = false):array |
133 | 133 | { |
134 | 134 | $halfWidth = $length / 2; |
135 | - $pixelPosition = (int) floor($halfWidth * $focusPosition / 100 + $halfWidth); |
|
135 | + $pixelPosition = (int)floor($halfWidth * $focusPosition / 100 + $halfWidth); |
|
136 | 136 | if ($invertScala) { |
137 | 137 | $pixelPosition = $length - $pixelPosition; |
138 | 138 | } |
139 | - $crop1 = (int) ($pixelPosition - floor($focusLength / 2)); |
|
140 | - $crop2 = (int) ($crop1 + $focusLength); |
|
139 | + $crop1 = (int)($pixelPosition - floor($focusLength / 2)); |
|
140 | + $crop2 = (int)($crop1 + $focusLength); |
|
141 | 141 | if ($crop1 < 0) { |
142 | 142 | $crop1 -= $crop1; |
143 | 143 | } elseif ($crop2 > $length) { |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | |
195 | 195 | $newFocusX = ($newRealFocusX - $newHalfWidth) * 100 / ($newHalfWidth); |
196 | 196 | $newFocusY = ($newHalfHeight - $newRealFocusY) * 100 / ($newHalfHeight); |
197 | - $newFocusX = (int) round($newFocusX, 0); |
|
198 | - $newFocusY = (int) round($newFocusY, 0); |
|
197 | + $newFocusX = (int)round($newFocusX, 0); |
|
198 | + $newFocusY = (int)round($newFocusY, 0); |
|
199 | 199 | |
200 | 200 | return [$newFocusX, $newFocusY]; |
201 | 201 | } |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | return [ |
221 | - MathUtility::canBeInterpretedAsInteger($ratio[0]) ? (int) $ratio[0] : (float) str_replace( |
|
221 | + MathUtility::canBeInterpretedAsInteger($ratio[0]) ? (int)$ratio[0] : (float)str_replace( |
|
222 | 222 | ',', |
223 | 223 | '.', |
224 | 224 | $ratio[0] |
225 | 225 | ), |
226 | - MathUtility::canBeInterpretedAsInteger($ratio[1]) ? (int) $ratio[1] : (float) str_replace( |
|
226 | + MathUtility::canBeInterpretedAsInteger($ratio[1]) ? (int)$ratio[1] : (float)str_replace( |
|
227 | 227 | ',', |
228 | 228 | '.', |
229 | 229 | $ratio[1] |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | ->execute()->fetchAll(); |
251 | 251 | |
252 | 252 | if (!empty($rows)) { |
253 | - return (string) $rows[0]['dimension']; |
|
253 | + return (string)$rows[0]['dimension']; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | return $ratio; |
@@ -26,12 +26,12 @@ |
||
26 | 26 | */ |
27 | 27 | public static function getFileByMetaData($uid) |
28 | 28 | { |
29 | - $row = GeneralUtility::makeInstance(SysFileMetadataRepository::class)->findByUid((int) $uid); |
|
29 | + $row = GeneralUtility::makeInstance(SysFileMetadataRepository::class)->findByUid((int)$uid); |
|
30 | 30 | if (!isset($row['file'])) { |
31 | 31 | throw new \Exception('File not found in metadata', 1475144028); |
32 | 32 | } |
33 | 33 | |
34 | - return self::getFileByUid((int) $row['file']); |
|
34 | + return self::getFileByUid((int)$row['file']); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $connection->update( |
55 | 55 | $this->getTableName(), |
56 | 56 | $values, |
57 | - ['uid' => (int) $uid] |
|
57 | + ['uid' => (int)$uid] |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 |