@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | // clone and reset and move to next month |
68 | 68 | $dateTime = clone $date; |
69 | - $dateTime->setDate((int) $dateTime->format('Y'), (int) $dateTime->format('m'), 1); |
|
69 | + $dateTime->setDate((int)$dateTime->format('Y'), (int)$dateTime->format('m'), 1); |
|
70 | 70 | $dateTime->modify($modify); |
71 | 71 | |
72 | 72 | $days = $this->getValidDays($day); |
@@ -162,15 +162,15 @@ discard block |
||
162 | 162 | protected function findDayInCurrentMonth(\DateTime $dateTime, string $direction, array $validDays, int $position = 1) |
163 | 163 | { |
164 | 164 | if (self::DIRECTION_UP === $direction) { |
165 | - $dateTime->setDate((int) $dateTime->format('Y'), (int) $dateTime->format('m'), 1); |
|
165 | + $dateTime->setDate((int)$dateTime->format('Y'), (int)$dateTime->format('m'), 1); |
|
166 | 166 | $modify = '+1 day'; |
167 | 167 | } else { |
168 | - $dateTime->setDate((int) $dateTime->format('Y'), (int) $dateTime->format('m'), (int) $dateTime->format('t')); |
|
168 | + $dateTime->setDate((int)$dateTime->format('Y'), (int)$dateTime->format('m'), (int)$dateTime->format('t')); |
|
169 | 169 | $modify = '-1 day'; |
170 | 170 | } |
171 | 171 | $validMonth = $dateTime->format('Y-m'); |
172 | 172 | while ($dateTime->format('Y-m') === $validMonth) { |
173 | - if (\in_array((int) $dateTime->format('N'), $validDays, true)) { |
|
173 | + if (\in_array((int)$dateTime->format('N'), $validDays, true)) { |
|
174 | 174 | --$position; |
175 | 175 | if (0 === $position) { |
176 | 176 | return $dateTime; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if (null === $configuration) { |
115 | 115 | throw new Exception('No valid configuration for the current index: ' . $this->getUniqueRegisterKey(), 123678123); |
116 | 116 | } |
117 | - $this->originalObject = EventUtility::getOriginalRecordByConfiguration($configuration, (int) $this->getForeignUid()); |
|
117 | + $this->originalObject = EventUtility::getOriginalRecordByConfiguration($configuration, (int)$this->getForeignUid()); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | return $this->originalObject; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | public function isAllDay() |
247 | 247 | { |
248 | - return (bool) $this->allDay; |
|
248 | + return (bool)$this->allDay; |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | /** |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | */ |
275 | 275 | public function getFeedTitle(): string |
276 | 276 | { |
277 | - return (string) $this->getTitle(); |
|
277 | + return (string)$this->getTitle(); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | /** |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function getFeedAbstract(): string |
286 | 286 | { |
287 | - return (string) $this->getFeedContent(); |
|
287 | + return (string)$this->getFeedContent(); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | /** |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function getFeedContent(): string |
296 | 296 | { |
297 | - return (string) $this->getDescription(); |
|
297 | + return (string)$this->getDescription(); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function getFeedLocation(): string |
306 | 306 | { |
307 | - return (string) $this->getLocation(); |
|
307 | + return (string)$this->getLocation(); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | /** |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function getRealUrlAliasBase(): string |
316 | 316 | { |
317 | - return (string) $this->getTitle(); |
|
317 | + return (string)$this->getTitle(); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | /** |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | */ |
367 | 367 | public function getKeSearchTitle(Index $index): string |
368 | 368 | { |
369 | - return (string) $this->getTitle() . ' - ' . $index->getStartDate() |
|
369 | + return (string)$this->getTitle() . ' - ' . $index->getStartDate() |
|
370 | 370 | ->format('d.m.Y'); |
371 | 371 | } |
372 | 372 | |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | */ |
380 | 380 | public function getKeSearchAbstract(Index $index): string |
381 | 381 | { |
382 | - return (string) $this->getDescription(); |
|
382 | + return (string)$this->getDescription(); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | */ |
392 | 392 | public function getKeSearchContent(Index $index): string |
393 | 393 | { |
394 | - return (string) $this->getDescription(); |
|
394 | + return (string)$this->getDescription(); |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | /** |
@@ -138,7 +138,7 @@ |
||
138 | 138 | */ |
139 | 139 | protected function nl2br($string) |
140 | 140 | { |
141 | - $string = \nl2br((string) $string); |
|
141 | + $string = \nl2br((string)$string); |
|
142 | 142 | |
143 | 143 | return \str_replace('\\n', '<br />', $string); |
144 | 144 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | protected static function loadConfiguration() |
40 | 40 | { |
41 | 41 | if (null === self::$configuration) { |
42 | - self::$configuration = (array) \unserialize((string) $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['calendarize']); |
|
42 | + self::$configuration = (array)\unserialize((string)$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['calendarize']); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public static function convertWeekYear2DayMonthYear($week, $year, $startDay = 1): \DateTime |
67 | 67 | { |
68 | - $week = \str_pad((string) $week, 2, '0', STR_PAD_LEFT); |
|
68 | + $week = \str_pad((string)$week, 2, '0', STR_PAD_LEFT); |
|
69 | 69 | |
70 | 70 | return self::normalizeDateTimeSingle(\strtotime($year . '-W' . $week . '-' . $startDay)); |
71 | 71 | } |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public static function getDaySecondsOfDateTime(\DateTime $dateTime): int |
93 | 93 | { |
94 | - $hours = (int) $dateTime->format('G'); |
|
95 | - $minutes = $hours * self::SECONDS_MINUTE + (int) $dateTime->format('i'); |
|
94 | + $hours = (int)$dateTime->format('G'); |
|
95 | + $minutes = $hours * self::SECONDS_MINUTE + (int)$dateTime->format('i'); |
|
96 | 96 | |
97 | - return $minutes * self::SECONDS_MINUTE + (int) $dateTime->format('s'); |
|
97 | + return $minutes * self::SECONDS_MINUTE + (int)$dateTime->format('s'); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if (!MathUtility::canBeInterpretedAsInteger($day)) { |
119 | 119 | $day = $date->format('d'); |
120 | 120 | } |
121 | - $date->setDate((int) $year, (int) $month, (int) $day); |
|
121 | + $date->setDate((int)$year, (int)$month, (int)$day); |
|
122 | 122 | $date->setTime(0, 0, 0); |
123 | 123 | if ($date->format('m') > $month) { |
124 | 124 | $date->modify('last day of last month'); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | { |
180 | 180 | // NOTE that new \DateTime('@timestamp') does NOT work - @see comment in normalizeDateTimeSingle() |
181 | 181 | // So we create a date string with timezone information first, and a \DateTime in the current server timezone then. |
182 | - return new \DateTime(\date(\DateTime::ATOM, (int) $GLOBALS['SIM_ACCESS_TIME'])); |
|
182 | + return new \DateTime(\date(\DateTime::ATOM, (int)$GLOBALS['SIM_ACCESS_TIME'])); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -27,7 +27,7 @@ |
||
27 | 27 | /** |
28 | 28 | * Adds a message to the FlashMessageQueue or prints it to the CLI. |
29 | 29 | * |
30 | - * @param mixed $message |
|
30 | + * @param string $message |
|
31 | 31 | * @param string $title |
32 | 32 | * @param int $severity |
33 | 33 | */ |
@@ -71,7 +71,7 @@ |
||
71 | 71 | * @param $table |
72 | 72 | * @param $uid |
73 | 73 | * |
74 | - * @return mixed |
|
74 | + * @return integer |
|
75 | 75 | */ |
76 | 76 | public function getIndexCount($table, $uid) |
77 | 77 | { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | return $databaseConnection->count('*', self::TABLE_NAME, [ |
81 | 81 | 'foreign_table' => $table, |
82 | - 'foreign_uid' => (int) $uid, |
|
82 | + 'foreign_uid' => (int)$uid, |
|
83 | 83 | ]); |
84 | 84 | } |
85 | 85 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $q->expr()->andX( |
105 | 105 | $q->expr()->gte('start_date', $now->getTimestamp()), |
106 | 106 | $q->expr()->eq('foreign_table', $q->createNamedParameter($table)), |
107 | - $q->expr()->eq('foreign_uid', $q->createNamedParameter((int) $uid, \PDO::PARAM_INT)) |
|
107 | + $q->expr()->eq('foreign_uid', $q->createNamedParameter((int)$uid, \PDO::PARAM_INT)) |
|
108 | 108 | ) |
109 | 109 | ) |
110 | 110 | ->addOrderBy('start_date', 'ASC') |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | { |
188 | 188 | foreach ($neededItem as $key => $value) { |
189 | 189 | if (MathUtility::canBeInterpretedAsInteger($value)) { |
190 | - if ((int) $value !== (int) $currentItem[$key]) { |
|
190 | + if ((int)$value !== (int)$currentItem[$key]) { |
|
191 | 191 | return false; |
192 | 192 | } |
193 | 193 | } else { |
194 | - if ((string) $value !== (string) $currentItem[$key]) { |
|
194 | + if ((string)$value !== (string)$currentItem[$key]) { |
|
195 | 195 | return false; |
196 | 196 | } |
197 | 197 | } |
@@ -258,9 +258,9 @@ discard block |
||
258 | 258 | $q->expr()->notIn('unique_register_key', $validKeys) |
259 | 259 | )->execute(); |
260 | 260 | |
261 | - return (bool) $q->execute(); |
|
261 | + return (bool)$q->execute(); |
|
262 | 262 | } |
263 | 263 | |
264 | - return (bool) $db->truncate(self::TABLE_NAME); |
|
264 | + return (bool)$db->truncate(self::TABLE_NAME); |
|
265 | 265 | } |
266 | 266 | } |
@@ -9,7 +9,6 @@ |
||
9 | 9 | |
10 | 10 | use DmitryDulepov\Realurl\Configuration\ConfigurationReader; |
11 | 11 | use DmitryDulepov\Realurl\Utility; |
12 | -use HDNET\Calendarize\Domain\Model\Index; |
|
13 | 12 | use HDNET\Calendarize\Service\IndexerService; |
14 | 13 | use HDNET\Calendarize\Utility\HelperUtility; |
15 | 14 | use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ); |
73 | 73 | |
74 | 74 | foreach ($q->execute()->fetchAll() as $row) { |
75 | - $removeIds[] = (int) $row['uid']; |
|
75 | + $removeIds[] = (int)$row['uid']; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | if (empty($removeIds)) { |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | ->fetch(); |
112 | 112 | |
113 | 113 | if (isset($row['value_id'])) { |
114 | - return (int) $row['value_id']; |
|
114 | + return (int)$row['value_id']; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | $matches = []; |
118 | 118 | if (\preg_match('/^idx-([0-9]+)$/', $value, $matches)) { |
119 | - return (int) $matches[1]; |
|
119 | + return (int)$matches[1]; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return 0; |
@@ -138,17 +138,17 @@ discard block |
||
138 | 138 | ->where( |
139 | 139 | $q->expr()->andX( |
140 | 140 | $q->expr()->eq('tablename', $q->expr()->literal(IndexerService::TABLE_NAME)), |
141 | - $q->expr()->eq('value_id', $q->createNamedParameter((int) $value, \PDO::PARAM_INT)) |
|
141 | + $q->expr()->eq('value_id', $q->createNamedParameter((int)$value, \PDO::PARAM_INT)) |
|
142 | 142 | ) |
143 | 143 | ) |
144 | 144 | ->execute() |
145 | 145 | ->fetch(); |
146 | 146 | |
147 | 147 | if (isset($row['value_alias'])) { |
148 | - return (string) $row['value_alias']; |
|
148 | + return (string)$row['value_alias']; |
|
149 | 149 | } |
150 | 150 | |
151 | - $alias = $this->getIndexBase((int) $value); |
|
151 | + $alias = $this->getIndexBase((int)$value); |
|
152 | 152 | $alias = $this->cleanUrl($alias); |
153 | 153 | |
154 | 154 | $entry = [ |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | $aliasBase = $alias; |
166 | - for ($i = 0;; ++$i) { |
|
166 | + for ($i = 0; ; ++$i) { |
|
167 | 167 | $alias = $i > 0 ? $aliasBase . '-' . $i : $aliasBase; |
168 | 168 | if (!$this->aliasAlreadyExists($alias)) { |
169 | 169 | $entry['value_alias'] = $alias; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $q->resetQueryParts(); |
175 | 175 | $q->insert('tx_realurl_uniqalias')->values($entry)->execute(); |
176 | 176 | |
177 | - return (string) $alias; |
|
177 | + return (string)$alias; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $db = HelperUtility::getDatabaseConnection('tx_realurl_uniqalias'); |
190 | 190 | $count = $db->count('*', 'tx_realurl_uniqalias', ['value_alias' => $db->quoteIdentifier($alias)]); |
191 | 191 | |
192 | - return (bool) $count; |
|
192 | + return (bool)$count; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $processedTitle = $utility->convertToSafeString($alias); |
218 | 218 | } |
219 | 219 | |
220 | - return (string) $processedTitle; |
|
220 | + return (string)$processedTitle; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |