@@ -74,6 +74,6 @@ |
||
74 | 74 | throw new \Exception('No meta data found', 1475144024); |
75 | 75 | } |
76 | 76 | |
77 | - return (int) $metaData['uid']; |
|
77 | + return (int)$metaData['uid']; |
|
78 | 78 | } |
79 | 79 | } |
@@ -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 | /** |
@@ -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 | } |
@@ -53,14 +53,14 @@ |
||
53 | 53 | case 'yp': |
54 | 54 | $metaData = $originalFile->_getMetaData(); |
55 | 55 | |
56 | - return (float) $metaData['focus_point_' . \mb_substr($parts[1], 0, 1)]; |
|
56 | + return (float)$metaData['focus_point_' . \mb_substr($parts[1], 0, 1)]; |
|
57 | 57 | case 'xp_positive': |
58 | 58 | case 'yp_positive': |
59 | 59 | $metaData = $originalFile->_getMetaData(); |
60 | 60 | if ('xp_positive' === $parts[1]) { |
61 | - return (int) (\abs($metaData['focus_point_' . \mb_substr($parts[1], 0, 1)] + 100) / 2); |
|
61 | + return (int)(\abs($metaData['focus_point_' . \mb_substr($parts[1], 0, 1)] + 100) / 2); |
|
62 | 62 | } |
63 | - return (int) (\abs($metaData['focus_point_' . \mb_substr($parts[1], 0, 1)] - 100) / 2); |
|
63 | + return (int)(\abs($metaData['focus_point_' . \mb_substr($parts[1], 0, 1)] - 100) / 2); |
|
64 | 64 | case 'w': |
65 | 65 | case 'h': |
66 | 66 | $fileName = GeneralUtility::getFileAbsFileName($fileObject->getPublicUrl(true)); |
@@ -115,11 +115,11 @@ |
||
115 | 115 | if ('tt_content' !== $parts[0]) { |
116 | 116 | throw new \Exception('Invalid part 0. part 0 have to be tt_content', 127383); |
117 | 117 | } |
118 | - $record = BackendUtility::getRecord($parts[0], (int) $parts[1]); |
|
118 | + $record = BackendUtility::getRecord($parts[0], (int)$parts[1]); |
|
119 | 119 | if (!isset($record['image_ratio'])) { |
120 | 120 | throw new \Exception('No image_ratio found in the current record', 324672); |
121 | 121 | } |
122 | 122 | |
123 | - return \trim((string) $record['image_ratio']); |
|
123 | + return \trim((string)$record['image_ratio']); |
|
124 | 124 | } |
125 | 125 | } |
@@ -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 |