@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | if (empty($configuration)) { |
123 | 123 | throw new Exception('No valid configuration for the current index: ' . $this->getUniqueRegisterKey(), 123678123); |
124 | 124 | } |
125 | - $this->originalObject = EventUtility::getOriginalRecordByConfiguration($configuration, (int) $this->getForeignUid()); |
|
125 | + $this->originalObject = EventUtility::getOriginalRecordByConfiguration($configuration, (int)$this->getForeignUid()); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return $this->originalObject; |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public function isAllDay() |
257 | 257 | { |
258 | - return (bool) $this->allDay; |
|
258 | + return (bool)$this->allDay; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function getSysLanguageUid() |
367 | 367 | { |
368 | - return (int) $this->_languageUid; |
|
368 | + return (int)$this->_languageUid; |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function isAllDay() |
208 | 208 | { |
209 | - return (bool) $this->allDay; |
|
209 | + return (bool)$this->allDay; |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function setAllDay($allDay) |
218 | 218 | { |
219 | - $this->allDay = (bool) $allDay; |
|
219 | + $this->allDay = (bool)$allDay; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | */ |
537 | 537 | public function isOpenEndTime() |
538 | 538 | { |
539 | - return (bool) $this->openEndTime; |
|
539 | + return (bool)$this->openEndTime; |
|
540 | 540 | } |
541 | 541 | |
542 | 542 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | protected function getIndexBase($indexUid): string |
39 | 39 | { |
40 | 40 | $indexRepository = HelperUtility::create(IndexRepository::class); |
41 | - $index = $indexRepository->findByUid((int) $indexUid); |
|
41 | + $index = $indexRepository->findByUid((int)$indexUid); |
|
42 | 42 | if (!($index instanceof Index)) { |
43 | 43 | return 'idx-' . $indexUid; |
44 | 44 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | $base = $originalObject->getRealUrlAliasBase(); |
52 | - if (!(bool) ConfigurationUtility::get('disableDateInSpeakingUrl')) { |
|
52 | + if (!(bool)ConfigurationUtility::get('disableDateInSpeakingUrl')) { |
|
53 | 53 | $datePart = $index->isAllDay() ? 'Y-m-d' : 'Y-m-d-' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
54 | 54 | $dateInfo = $index->getStartDateComplete() |
55 | 55 | ->format($datePart); |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | $base .= '-' . $dateInfo; |
58 | 58 | } |
59 | 59 | |
60 | - if ((bool) ConfigurationUtility::get('addIndexInSpeakingUrl') || \class_exists(PersistedAliasMapper::class)) { |
|
60 | + if ((bool)ConfigurationUtility::get('addIndexInSpeakingUrl') || \class_exists(PersistedAliasMapper::class)) { |
|
61 | 61 | $base .= '-' . $indexUid; |
62 | 62 | } |
63 | 63 | |
64 | - return (string) $base; |
|
64 | + return (string)$base; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | public function coolUri($xml, $value) |
61 | 61 | { |
62 | - $alias = $this->getIndexBase((int) $value); |
|
62 | + $alias = $this->getIndexBase((int)$value); |
|
63 | 63 | $alias = $this->prepareBase($alias); |
64 | 64 | $alias = Functions::URLize($alias); |
65 | 65 | $alias = Functions::sanitize_title_with_dashes($alias); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | switch ($configuration->getEndDateDynamic()) { |
66 | 66 | case Configuration::END_DYNAMIC_1_DAY: |
67 | - $callback = function ($entry) { |
|
67 | + $callback = function($entry) { |
|
68 | 68 | if ($entry['start_date'] instanceof \DateTime) { |
69 | 69 | $entry['end_date'] = clone $entry['start_date']; |
70 | 70 | $entry['end_date']->modify('+1 day'); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | }; |
75 | 75 | break; |
76 | 76 | case Configuration::END_DYNAMIC_1_WEEK: |
77 | - $callback = function ($entry) { |
|
77 | + $callback = function($entry) { |
|
78 | 78 | if ($entry['start_date'] instanceof \DateTime) { |
79 | 79 | $entry['end_date'] = clone $entry['start_date']; |
80 | 80 | $entry['end_date']->modify('+1 week'); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | }; |
85 | 85 | break; |
86 | 86 | case Configuration::END_DYNAMIC_END_WEEK: |
87 | - $callback = function ($entry) { |
|
87 | + $callback = function($entry) { |
|
88 | 88 | if ($entry['start_date'] instanceof \DateTime) { |
89 | 89 | $entry['end_date'] = clone $entry['start_date']; |
90 | 90 | $entry['end_date']->modify('monday next week'); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | }; |
96 | 96 | break; |
97 | 97 | case Configuration::END_DYNAMIC_END_MONTH: |
98 | - $callback = function ($entry) { |
|
98 | + $callback = function($entry) { |
|
99 | 99 | if ($entry['start_date'] instanceof \DateTime) { |
100 | 100 | $entry['end_date'] = clone $entry['start_date']; |
101 | 101 | $entry['end_date']->modify('last day of this month'); |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | break; |
107 | 107 | case Configuration::END_DYNAMIC_END_YEAR: |
108 | 108 | |
109 | - $callback = function ($entry) { |
|
109 | + $callback = function($entry) { |
|
110 | 110 | if ($entry['start_date'] instanceof \DateTime) { |
111 | 111 | $entry['end_date'] = clone $entry['start_date']; |
112 | - $entry['end_date']->setDate((int) $entry['end_date']->format('Y'), 12, 31); |
|
112 | + $entry['end_date']->setDate((int)$entry['end_date']->format('Y'), 12, 31); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return $entry; |
@@ -383,10 +383,10 @@ discard block |
||
383 | 383 | // if not set get values from extension configuration |
384 | 384 | if (null === $tillDays && null === $tillDaysPast) { |
385 | 385 | $tillDays = ConfigurationUtility::get('tillDays'); |
386 | - $tillDays = MathUtility::canBeInterpretedAsInteger($tillDays) ? (int) $tillDays : null; |
|
386 | + $tillDays = MathUtility::canBeInterpretedAsInteger($tillDays) ? (int)$tillDays : null; |
|
387 | 387 | $tillDaysPast = ConfigurationUtility::get('tillDaysPast'); |
388 | - $tillDaysPast = MathUtility::canBeInterpretedAsInteger($tillDaysPast) ? (int) $tillDaysPast : null; |
|
389 | - $tillDaysRelative = (bool) ConfigurationUtility::get('tillDaysRelative'); |
|
388 | + $tillDaysPast = MathUtility::canBeInterpretedAsInteger($tillDaysPast) ? (int)$tillDaysPast : null; |
|
389 | + $tillDaysRelative = (bool)ConfigurationUtility::get('tillDaysRelative'); |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | // get base date for till tillDate and tillDatePast calculation |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | */ |
423 | 423 | protected function getFrequencyLimitPerItem(): int |
424 | 424 | { |
425 | - $maxLimit = (int) ConfigurationUtility::get('frequencyLimitPerItem'); |
|
425 | + $maxLimit = (int)ConfigurationUtility::get('frequencyLimitPerItem'); |
|
426 | 426 | if ($maxLimit <= 0) { |
427 | 427 | $maxLimit = 300; |
428 | 428 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | ->where( |
37 | 37 | $q->expr()->andX( |
38 | 38 | $q->expr()->eq('tablenames', $q->quote('tx_cal_event')), |
39 | - $q->expr()->eq('uid_foreign', $q->createNamedParameter((int) $event['uid'], \PDO::PARAM_INT)) |
|
39 | + $q->expr()->eq('uid_foreign', $q->createNamedParameter((int)$event['uid'], \PDO::PARAM_INT)) |
|
40 | 40 | ) |
41 | 41 | ); |
42 | 42 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $importId = CalMigrationUpdate::IMPORT_PREFIX . $selectResult['uid']; |
50 | 50 | |
51 | 51 | $fieldValues = [ |
52 | - 'uid_foreign' => (int) $recordId, |
|
52 | + 'uid_foreign' => (int)$recordId, |
|
53 | 53 | 'tablenames' => $table, |
54 | 54 | ]; |
55 | 55 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $parts = GeneralUtility::trimExplode('-', $value, true); |
46 | 46 | |
47 | - return (int) \array_pop($parts); |
|
47 | + return (int)\array_pop($parts); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | protected function id2alias($value): string |
58 | 58 | { |
59 | - $alias = $this->getIndexBase((int) $value); |
|
59 | + $alias = $this->getIndexBase((int)$value); |
|
60 | 60 | |
61 | 61 | // Because the Slug helper do not remove "/" chars |
62 | 62 | $alias = \str_replace('/', '-', $alias); |
@@ -64,6 +64,6 @@ discard block |
||
64 | 64 | $slugHelper = GeneralUtility::makeInstance(SlugHelper::class, 'pages', 'uid', []); |
65 | 65 | $alias = $slugHelper->sanitize($alias); |
66 | 66 | |
67 | - return (string) $alias; |
|
67 | + return (string)$alias; |
|
68 | 68 | } |
69 | 69 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | // overlays can connect with l10n_paretn to the right default record. |
64 | 64 | $q->select('uid') |
65 | 65 | ->from($tableName) |
66 | - ->orderBy((string) $transPointer); |
|
66 | + ->orderBy((string)$transPointer); |
|
67 | 67 | } else { |
68 | 68 | $q->select('uid') |
69 | 69 | ->from($tableName); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | // Note: "uid" could be e.g. NEW6273482 in DataHandler process |
111 | 111 | if (MathUtility::canBeInterpretedAsInteger($uid)) { |
112 | - return (int) $this->getCurrentItems($tableName, $uid)->rowCount(); |
|
112 | + return (int)$this->getCurrentItems($tableName, $uid)->rowCount(); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return 0; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $q->expr()->andX( |
139 | 139 | $q->expr()->gte('start_date', $q->createNamedParameter(DateTimeUtility::getNow()->format('Y-m-d'))), |
140 | 140 | $q->expr()->eq('foreign_table', $q->createNamedParameter($table)), |
141 | - $q->expr()->eq('foreign_uid', $q->createNamedParameter((int) $uid, \PDO::PARAM_INT)) |
|
141 | + $q->expr()->eq('foreign_uid', $q->createNamedParameter((int)$uid, \PDO::PARAM_INT)) |
|
142 | 142 | ) |
143 | 143 | ) |
144 | 144 | ->addOrderBy('start_date', 'ASC') |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | $q->expr()->notIn('unique_register_key', $validKeys) |
285 | 285 | )->execute(); |
286 | 286 | |
287 | - return (bool) $q->execute(); |
|
287 | + return (bool)$q->execute(); |
|
288 | 288 | } |
289 | 289 | |
290 | - return (bool) $db->truncate(self::TABLE_NAME); |
|
290 | + return (bool)$db->truncate(self::TABLE_NAME); |
|
291 | 291 | } |
292 | 292 | } |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | $configurations = GeneralUtility::intExplode(',', $rawRecord['calendarize'], true); |
37 | 37 | |
38 | 38 | $transPointer = $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'] ?? false; // e.g. l10n_parent |
39 | - if ($transPointer && (int) $rawRecord[$transPointer] > 0) { |
|
40 | - $rawOriginalRecord = BackendUtility::getRecord($tableName, (int) $rawRecord[$transPointer]); |
|
39 | + if ($transPointer && (int)$rawRecord[$transPointer] > 0) { |
|
40 | + $rawOriginalRecord = BackendUtility::getRecord($tableName, (int)$rawRecord[$transPointer]); |
|
41 | 41 | $configurations = GeneralUtility::intExplode(',', $rawOriginalRecord['calendarize'], true); |
42 | 42 | } |
43 | 43 | |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | $languageField = $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] ?? false; // e.g. sys_language_uid |
86 | 86 | $transPointer = $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'] ?? false; // e.g. l10n_parent |
87 | 87 | |
88 | - if ($transPointer && (int) $record[$transPointer] > 0) { |
|
88 | + if ($transPointer && (int)$record[$transPointer] > 0) { |
|
89 | 89 | foreach ($neededItems as $key => $value) { |
90 | 90 | $originalRecord = BackendUtility::getRecord($value['foreign_table'], $value['foreign_uid']); |
91 | 91 | |
92 | 92 | $searchFor = $value; |
93 | - $searchFor['foreign_uid'] = (int) $originalRecord[$transPointer]; |
|
93 | + $searchFor['foreign_uid'] = (int)$originalRecord[$transPointer]; |
|
94 | 94 | |
95 | 95 | $db = HelperUtility::getDatabaseConnection(IndexerService::TABLE_NAME); |
96 | 96 | $q = $db->createQueryBuilder(); |
@@ -99,19 +99,19 @@ discard block |
||
99 | 99 | if (\is_string($val)) { |
100 | 100 | $where[] = $q->expr()->eq($field, $q->quote($val)); |
101 | 101 | } else { |
102 | - $where[] = $q->expr()->eq($field, (int) $val); |
|
102 | + $where[] = $q->expr()->eq($field, (int)$val); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
106 | 106 | $result = $q->select('uid')->from(IndexerService::TABLE_NAME)->andWhere(...$where)->execute()->fetch(); |
107 | 107 | if (isset($result['uid'])) { |
108 | - $neededItems[$key]['l10n_parent'] = (int) $result['uid']; |
|
108 | + $neededItems[$key]['l10n_parent'] = (int)$result['uid']; |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | - if ($languageField && 0 !== (int) $record[$languageField]) { |
|
114 | - $language = (int) $record[$languageField]; |
|
113 | + if ($languageField && 0 !== (int)$record[$languageField]) { |
|
114 | + $language = (int)$record[$languageField]; |
|
115 | 115 | foreach (\array_keys($neededItems) as $key) { |
116 | 116 | $neededItems[$key]['sys_language_uid'] = $language; |
117 | 117 | } |
@@ -134,16 +134,16 @@ discard block |
||
134 | 134 | |
135 | 135 | $addFields = []; |
136 | 136 | if (isset($enableFields['disabled'])) { |
137 | - $addFields['hidden'] = (int) $record[$enableFields['disabled']]; |
|
137 | + $addFields['hidden'] = (int)$record[$enableFields['disabled']]; |
|
138 | 138 | } |
139 | 139 | if (isset($enableFields['starttime'])) { |
140 | - $addFields['starttime'] = (int) $record[$enableFields['starttime']]; |
|
140 | + $addFields['starttime'] = (int)$record[$enableFields['starttime']]; |
|
141 | 141 | } |
142 | 142 | if (isset($enableFields['endtime'])) { |
143 | - $addFields['endtime'] = (int) $record[$enableFields['endtime']]; |
|
143 | + $addFields['endtime'] = (int)$record[$enableFields['endtime']]; |
|
144 | 144 | } |
145 | 145 | if (isset($enableFields['fe_group'])) { |
146 | - $addFields['fe_group'] = (string) $record[$enableFields['fe_group']]; |
|
146 | + $addFields['fe_group'] = (string)$record[$enableFields['fe_group']]; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | foreach ($neededItems as $key => $value) { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | if ($value instanceof \DateTimeInterface) { |
163 | 163 | $record[$key] = $value->format('Y-m-d'); |
164 | 164 | } elseif (\is_bool($value) || 'start_time' === $key || 'end_time' === $key) { |
165 | - $record[$key] = (int) $value; |
|
165 | + $record[$key] = (int)$value; |
|
166 | 166 | } elseif (null === $value) { |
167 | 167 | $record[$key] = ''; |
168 | 168 | } |