@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function getCurrentPoint() |
47 | 47 | { |
48 | - $row = GeneralUtility::makeInstance(SysFileMetadataRepository::class)->findByUid((int) $this->getMataDataUid()); |
|
48 | + $row = GeneralUtility::makeInstance(SysFileMetadataRepository::class)->findByUid((int)$this->getMataDataUid()); |
|
49 | 49 | |
50 | 50 | return $this->cleanupPosition([ |
51 | 51 | $row['focus_point_x'], |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'focus_point_y' => MathUtility::forceIntegerInRange($y, -100, 100, 0), |
67 | 67 | ]; |
68 | 68 | |
69 | - GeneralUtility::makeInstance(SysFileMetadataRepository::class)->update((int) $this->getMataDataUid(), $values); |
|
69 | + GeneralUtility::makeInstance(SysFileMetadataRepository::class)->update((int)$this->getMataDataUid(), $values); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | } |
95 | 95 | $p = $parameter['P']; |
96 | 96 | if (isset($p['metaUid']) && MathUtility::canBeInterpretedAsInteger($p['metaUid'])) { |
97 | - return (int) $p['metaUid']; |
|
97 | + return (int)$p['metaUid']; |
|
98 | 98 | } |
99 | 99 | if (isset($p['table']) && 'sys_file_metadata' === $p['table'] && isset($p['uid']) && MathUtility::canBeInterpretedAsInteger($p['uid'])) { |
100 | - return (int) $p['uid']; |
|
100 | + return (int)$p['uid']; |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | } |
@@ -78,16 +78,16 @@ discard block |
||
78 | 78 | 'focus_point_y' => MathUtility::forceIntegerInRange($y, -100, 100, 0), |
79 | 79 | ]; |
80 | 80 | |
81 | - GeneralUtility::makeInstance(SysFileReferenceRepository::class)->update((int) $this->getReferenceUid(), $values); |
|
81 | + GeneralUtility::makeInstance(SysFileReferenceRepository::class)->update((int)$this->getReferenceUid(), $values); |
|
82 | 82 | |
83 | 83 | // save also to the file |
84 | 84 | $reference = ResourceFactory::getInstance()->getFileReferenceObject($this->getReferenceUid()); |
85 | 85 | $fileUid = $reference->getOriginalFile()->getUid(); |
86 | 86 | |
87 | 87 | $sysFileMatadataRepository = GeneralUtility::makeInstance(SysFileMetadataRepository::class); |
88 | - $row = $sysFileMatadataRepository->findOneByFileUid((int) $fileUid); |
|
88 | + $row = $sysFileMatadataRepository->findOneByFileUid((int)$fileUid); |
|
89 | 89 | if ($row) { |
90 | - $sysFileMatadataRepository->update((int) $row['uid'], $values); |
|
90 | + $sysFileMatadataRepository->update((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 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function getCurrentPoint() |
35 | 35 | { |
36 | 36 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(self::TABLE); |
37 | - $rows = (array) $queryBuilder->select('uid', 'focus_point_x', 'focus_point_y') |
|
37 | + $rows = (array)$queryBuilder->select('uid', 'focus_point_x', 'focus_point_y') |
|
38 | 38 | ->from(self::TABLE) |
39 | 39 | ->where( |
40 | 40 | $queryBuilder->expr()->eq('relative_file_path', $queryBuilder->createNamedParameter($this->getRelativeFilePath())) |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $fileStandaloneRepository = GeneralUtility::makeInstance(FileStandaloneRepository::class); |
64 | 64 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(self::TABLE); |
65 | - $rows = (array) $queryBuilder->select('uid') |
|
65 | + $rows = (array)$queryBuilder->select('uid') |
|
66 | 66 | ->from(self::TABLE) |
67 | 67 | ->where( |
68 | 68 | $queryBuilder->expr()->eq('relative_file_path', $queryBuilder->createNamedParameter($this->getRelativeFilePath())) |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | if (!empty($rows)) { |
80 | 80 | $fileStandaloneRepository->update( |
81 | - (int) $rows[0]['uid'], |
|
81 | + (int)$rows[0]['uid'], |
|
82 | 82 | $values |
83 | 83 | ); |
84 | 84 | } else { |
@@ -146,14 +146,14 @@ |
||
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 | $row = GeneralUtility::makeInstance(FileStandaloneRepository::class)->findOneByRelativeFilePath($relativeSrc); |
154 | 154 | if (isset($row['focus_point_x'])) { |
155 | - $focusPointX = MathUtility::forceIntegerInRange((int) $row['focus_point_x'], -100, 100, 0); |
|
156 | - $focusPointY = MathUtility::forceIntegerInRange((int) $row['focus_point_y'], -100, 100, 0); |
|
155 | + $focusPointX = MathUtility::forceIntegerInRange((int)$row['focus_point_x'], -100, 100, 0); |
|
156 | + $focusPointY = MathUtility::forceIntegerInRange((int)$row['focus_point_y'], -100, 100, 0); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function getFocusWidthAndHeight(int $width, int $height, string $ratio): array |
64 | 64 | { |
65 | - $width = (int) $width; |
|
66 | - $height = (int) $height; |
|
65 | + $width = (int)$width; |
|
66 | + $height = (int)$height; |
|
67 | 67 | $ratio = $this->getRatio($ratio); |
68 | 68 | $widthDiff = $width / $ratio[0]; |
69 | 69 | $heightDiff = $height / $ratio[1]; |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | if ($widthDiff < $heightDiff) { |
72 | 72 | return [ |
73 | 73 | $width, |
74 | - (int) \ceil($widthDiff / $heightDiff * $height), |
|
74 | + (int)\ceil($widthDiff / $heightDiff * $height), |
|
75 | 75 | ]; |
76 | 76 | } |
77 | 77 | if ($widthDiff > $heightDiff) { |
78 | 78 | return [ |
79 | - (int) \ceil($heightDiff / $widthDiff * $width), |
|
79 | + (int)\ceil($heightDiff / $widthDiff * $width), |
|
80 | 80 | $height, |
81 | 81 | ]; |
82 | 82 | } |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | |
163 | 163 | $newFocusX = ($newRealFocusX - $newHalfWidth) * 100 / ($newHalfWidth); |
164 | 164 | $newFocusY = ($newHalfHeight - $newRealFocusY) * 100 / ($newHalfHeight); |
165 | - $newFocusX = (int) \round($newFocusX, 0); |
|
166 | - $newFocusY = (int) \round($newFocusY, 0); |
|
165 | + $newFocusX = (int)\round($newFocusX, 0); |
|
166 | + $newFocusY = (int)\round($newFocusY, 0); |
|
167 | 167 | |
168 | 168 | return [$newFocusX, $newFocusY]; |
169 | 169 | } |
@@ -186,12 +186,12 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | return [ |
189 | - MathUtility::canBeInterpretedAsInteger($ratio[0]) ? (int) $ratio[0] : (float) \str_replace( |
|
189 | + MathUtility::canBeInterpretedAsInteger($ratio[0]) ? (int)$ratio[0] : (float)\str_replace( |
|
190 | 190 | ',', |
191 | 191 | '.', |
192 | 192 | $ratio[0] |
193 | 193 | ), |
194 | - MathUtility::canBeInterpretedAsInteger($ratio[1]) ? (int) $ratio[1] : (float) \str_replace( |
|
194 | + MathUtility::canBeInterpretedAsInteger($ratio[1]) ? (int)$ratio[1] : (float)\str_replace( |
|
195 | 195 | ',', |
196 | 196 | '.', |
197 | 197 | $ratio[1] |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | protected function getShiftedFocusAreaPosition(int $length, int $focusLength, int $focusPosition, bool $invertScala = false): array |
213 | 213 | { |
214 | 214 | $halfWidth = $length / 2; |
215 | - $pixelPosition = (int) \floor($halfWidth * $focusPosition / 100 + $halfWidth); |
|
215 | + $pixelPosition = (int)\floor($halfWidth * $focusPosition / 100 + $halfWidth); |
|
216 | 216 | if ($invertScala) { |
217 | 217 | $pixelPosition = $length - $pixelPosition; |
218 | 218 | } |
219 | - $crop1 = (int) ($pixelPosition - \floor($focusLength / 2)); |
|
220 | - $crop2 = (int) ($crop1 + $focusLength); |
|
219 | + $crop1 = (int)($pixelPosition - \floor($focusLength / 2)); |
|
220 | + $crop2 = (int)($crop1 + $focusLength); |
|
221 | 221 | if ($crop1 < 0) { |
222 | 222 | $crop1 -= $crop1; |
223 | 223 | } elseif ($crop2 > $length) { |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | { |
246 | 246 | $row = GeneralUtility::makeInstance(DimensionRepository::class)->findOneByIdentifier($ratio); |
247 | 247 | if (isset($row['dimension'])) { |
248 | - return (string) $row['dimension']; |
|
248 | + return (string)$row['dimension']; |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | return $ratio; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $queryBuilder = $this->getQueryBuilder(); |
46 | 46 | |
47 | - return (array) $queryBuilder->select('*') |
|
47 | + return (array)$queryBuilder->select('*') |
|
48 | 48 | ->from($this->getTableName()) |
49 | 49 | ->execute() |
50 | 50 | ->fetchAll(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->getConnection()->update( |
62 | 62 | $this->getTableName(), |
63 | 63 | $values, |
64 | - ['uid' => (int) $uid] |
|
64 | + ['uid' => (int)$uid] |
|
65 | 65 | ); |
66 | 66 | } |
67 | 67 |