@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | /** |
| 171 | 171 | * Reset the DateTime. |
| 172 | 172 | */ |
| 173 | - public static function resetTime(string|\DateTimeInterface|null $dateTime = null): \DateTime |
|
| 173 | + public static function resetTime(string | \DateTimeInterface | null $dateTime = null): \DateTime |
|
| 174 | 174 | { |
| 175 | 175 | $dateTime = self::normalizeDateTimeSingle($dateTime); |
| 176 | 176 | $dateTime->setTime(0, 0); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * @throws \Exception |
| 185 | 185 | */ |
| 186 | 186 | public static function normalizeDateTimeSingle( |
| 187 | - int|string|\DateTimeInterface|null $dateInformation = null, |
|
| 187 | + int | string | \DateTimeInterface | null $dateInformation = null, |
|
| 188 | 188 | ?\DateTimeZone $timezone = null |
| 189 | 189 | ): \DateTime { |
| 190 | 190 | $timezone = $timezone ?? self::getTimeZone(); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * |
| 234 | 234 | * @see resetTime() |
| 235 | 235 | */ |
| 236 | - public static function getDayStart(string|\DateTimeInterface $dateInformation): \DateTime |
|
| 236 | + public static function getDayStart(string | \DateTimeInterface $dateInformation): \DateTime |
|
| 237 | 237 | { |
| 238 | 238 | return self::resetTime($dateInformation); |
| 239 | 239 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | /** |
| 242 | 242 | * Get the End of the given day. |
| 243 | 243 | */ |
| 244 | - public static function getDayEnd(string|\DateTimeInterface $dateInformation): \DateTime |
|
| 244 | + public static function getDayEnd(string | \DateTimeInterface $dateInformation): \DateTime |
|
| 245 | 245 | { |
| 246 | 246 | $dateTime = self::resetTime($dateInformation); |
| 247 | 247 | $dateTime->setTime(23, 59, 59); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | OptionRequest $options, |
| 81 | 81 | array $allowedPages = [], |
| 82 | 82 | bool $ignoreEnableFields = true |
| 83 | - ): array|QueryResultInterface { |
|
| 83 | + ): array | QueryResultInterface { |
|
| 84 | 84 | $query = $this->createQuery(); |
| 85 | 85 | $querySettings = $query->getQuerySettings(); |
| 86 | 86 | $querySettings->setIgnoreEnableFields($ignoreEnableFields); |
@@ -142,12 +142,12 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function findList( |
| 144 | 144 | int $limit = 0, |
| 145 | - int|string $listStartTime = 0, |
|
| 145 | + int | string $listStartTime = 0, |
|
| 146 | 146 | int $startOffsetHours = 0, |
| 147 | 147 | int $overrideStartDate = 0, |
| 148 | 148 | int $overrideEndDate = 0, |
| 149 | 149 | bool $ignoreStoragePid = false |
| 150 | - ): array|QueryResultInterface { |
|
| 150 | + ): array | QueryResultInterface { |
|
| 151 | 151 | $startTime = DateTimeUtility::getNow(); |
| 152 | 152 | $endTime = null; |
| 153 | 153 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | ?\DateTimeInterface $endDate = null, |
| 189 | 189 | array $customSearch = [], |
| 190 | 190 | int $limit = 0 |
| 191 | - ): array|QueryResultInterface { |
|
| 191 | + ): array | QueryResultInterface { |
|
| 192 | 192 | $event = $this->eventDispatcher->dispatch(new IndexRepositoryFindBySearchEvent( |
| 193 | 193 | $startDate, |
| 194 | 194 | $endDate, |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | /** |
| 225 | 225 | * Find Past Events. |
| 226 | 226 | */ |
| 227 | - public function findByPast(int $limit, string $sort, string $listStartTime = '0'): array|QueryResultInterface |
|
| 227 | + public function findByPast(int $limit, string $sort, string $listStartTime = '0'): array | QueryResultInterface |
|
| 228 | 228 | { |
| 229 | 229 | $now = DateTimeUtility::getNow(); |
| 230 | 230 | if ('now' !== $listStartTime) { |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | /** |
| 251 | 251 | * Find by Index UIDs. |
| 252 | 252 | */ |
| 253 | - public function findByUids(array $uids): array|QueryResultInterface |
|
| 253 | + public function findByUids(array $uids): array | QueryResultInterface |
|
| 254 | 254 | { |
| 255 | 255 | $query = $this->createQuery(); |
| 256 | 256 | $query->setOrderings($this->getSorting(QueryInterface::ORDER_ASCENDING)); |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | int $limit = 100, |
| 272 | 272 | string $sort = QueryInterface::ORDER_ASCENDING, |
| 273 | 273 | bool $useIndexTime = false |
| 274 | - ): array|QueryResultInterface { |
|
| 274 | + ): array | QueryResultInterface { |
|
| 275 | 275 | if (!$future && !$past) { |
| 276 | 276 | return []; |
| 277 | 277 | } |
@@ -295,8 +295,7 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | $query->setLimit($limit); |
| 297 | 297 | $sort = QueryInterface::ORDER_ASCENDING === $sort ? |
| 298 | - QueryInterface::ORDER_ASCENDING : |
|
| 299 | - QueryInterface::ORDER_DESCENDING; |
|
| 298 | + QueryInterface::ORDER_ASCENDING : QueryInterface::ORDER_DESCENDING; |
|
| 300 | 299 | $query->setOrderings($this->getSorting($sort)); |
| 301 | 300 | |
| 302 | 301 | return $this->matchAndExecute($query, $constraints); |
@@ -310,7 +309,7 @@ discard block |
||
| 310 | 309 | int $limit = 100, |
| 311 | 310 | string $sort = QueryInterface::ORDER_ASCENDING, |
| 312 | 311 | ?\DateTimeImmutable $referenceDate = null |
| 313 | - ): array|QueryResultInterface { |
|
| 312 | + ): array | QueryResultInterface { |
|
| 314 | 313 | if (!$future && !$past) { |
| 315 | 314 | return []; |
| 316 | 315 | } |
@@ -333,8 +332,7 @@ discard block |
||
| 333 | 332 | $query->setLimit($limit); |
| 334 | 333 | } |
| 335 | 334 | $sort = QueryInterface::ORDER_ASCENDING === $sort ? |
| 336 | - QueryInterface::ORDER_ASCENDING : |
|
| 337 | - QueryInterface::ORDER_DESCENDING; |
|
| 335 | + QueryInterface::ORDER_ASCENDING : QueryInterface::ORDER_DESCENDING; |
|
| 338 | 336 | $query->setOrderings($this->getSorting($sort)); |
| 339 | 337 | |
| 340 | 338 | return $this->matchAndExecute($query, $constraints); |
@@ -349,7 +347,7 @@ discard block |
||
| 349 | 347 | bool $past = false, |
| 350 | 348 | int $limit = 100, |
| 351 | 349 | string $sort = QueryInterface::ORDER_ASCENDING |
| 352 | - ): array|QueryResultInterface { |
|
| 350 | + ): array | QueryResultInterface { |
|
| 353 | 351 | if (!$future && !$past) { |
| 354 | 352 | return []; |
| 355 | 353 | } |
@@ -371,7 +369,7 @@ discard block |
||
| 371 | 369 | /** |
| 372 | 370 | * find Year. |
| 373 | 371 | */ |
| 374 | - public function findYear(int $year): array|QueryResultInterface |
|
| 372 | + public function findYear(int $year): array | QueryResultInterface |
|
| 375 | 373 | { |
| 376 | 374 | $startTime = (new \DateTimeImmutable('midnight'))->setDate($year, 1, 1); |
| 377 | 375 | $endTime = $startTime->modify('+1 year -1 second'); |
@@ -382,7 +380,7 @@ discard block |
||
| 382 | 380 | /** |
| 383 | 381 | * find quarter. |
| 384 | 382 | */ |
| 385 | - public function findQuarter(int $year, int $quarter): array|QueryResultInterface |
|
| 383 | + public function findQuarter(int $year, int $quarter): array | QueryResultInterface |
|
| 386 | 384 | { |
| 387 | 385 | $startMonth = 1 + (3 * ($quarter - 1)); |
| 388 | 386 | $startTime = (new \DateTimeImmutable('midnight'))->setDate($year, $startMonth, 1); |
@@ -394,7 +392,7 @@ discard block |
||
| 394 | 392 | /** |
| 395 | 393 | * find Month. |
| 396 | 394 | */ |
| 397 | - public function findMonth(int $year, int $month): array|QueryResultInterface |
|
| 395 | + public function findMonth(int $year, int $month): array | QueryResultInterface |
|
| 398 | 396 | { |
| 399 | 397 | $startTime = (new \DateTimeImmutable('midnight'))->setDate($year, $month, 1); |
| 400 | 398 | $endTime = $startTime->modify('+1 month -1 second'); |
@@ -405,7 +403,7 @@ discard block |
||
| 405 | 403 | /** |
| 406 | 404 | * find Week. |
| 407 | 405 | */ |
| 408 | - public function findWeek(int $year, int $week, int $weekStart = 1): array|QueryResultInterface |
|
| 406 | + public function findWeek(int $year, int $week, int $weekStart = 1): array | QueryResultInterface |
|
| 409 | 407 | { |
| 410 | 408 | $startTime = \DateTimeImmutable::createFromMutable( |
| 411 | 409 | DateTimeUtility::convertWeekYear2DayMonthYear($week, $year, $weekStart) |
@@ -418,7 +416,7 @@ discard block |
||
| 418 | 416 | /** |
| 419 | 417 | * find day. |
| 420 | 418 | */ |
| 421 | - public function findDay(int $year, int $month, int $day): array|QueryResultInterface |
|
| 419 | + public function findDay(int $year, int $month, int $day): array | QueryResultInterface |
|
| 422 | 420 | { |
| 423 | 421 | $startTime = (new \DateTimeImmutable('midnight'))->setDate($year, $month, $day); |
| 424 | 422 | $endTime = $startTime->modify('+1 day -1 second'); |
@@ -456,7 +454,7 @@ discard block |
||
| 456 | 454 | public function findByTimeSlot( |
| 457 | 455 | ?\DateTimeInterface $startTime, |
| 458 | 456 | ?\DateTimeInterface $endTime = null |
| 459 | - ): array|QueryResultInterface { |
|
| 457 | + ): array | QueryResultInterface { |
|
| 460 | 458 | $query = $this->createQuery(); |
| 461 | 459 | $constraints = $this->getDefaultConstraints($query); |
| 462 | 460 | $this->addTimeFrameConstraints($constraints, $query, $startTime, $endTime); |
@@ -471,7 +469,7 @@ discard block |
||
| 471 | 469 | /** |
| 472 | 470 | * Find all indices by the given Event model. |
| 473 | 471 | */ |
| 474 | - public function findByEvent(DomainObjectInterface $event): array|QueryResultInterface |
|
| 472 | + public function findByEvent(DomainObjectInterface $event): array | QueryResultInterface |
|
| 475 | 473 | { |
| 476 | 474 | return $this->findByEventTraversing( |
| 477 | 475 | $event, |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | string $recurrence, |
| 35 | 35 | string $day, |
| 36 | 36 | int $interval = 1 |
| 37 | - ): \DateTime|false { |
|
| 37 | + ): \DateTime | false { |
|
| 38 | 38 | return $this->getRecurrenceForCurrentMonth($date, $recurrence, $day, '+' . $interval . ' month'); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | string $recurrence, |
| 47 | 47 | string $day, |
| 48 | 48 | int $interval = 1 |
| 49 | - ): \DateTime|false { |
|
| 49 | + ): \DateTime | false { |
|
| 50 | 50 | return $this->getRecurrenceForCurrentMonth($date, $recurrence, $day, '+' . $interval . ' year'); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | string $recurrence, |
| 59 | 59 | string $day, |
| 60 | 60 | string $modify |
| 61 | - ): \DateTime|false { |
|
| 61 | + ): \DateTime | false { |
|
| 62 | 62 | // clone and reset and move to next month |
| 63 | 63 | $dateTime = clone $date; |
| 64 | 64 | $dateTime->setDate((int)$dateTime->format('Y'), (int)$dateTime->format('m'), 1); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | string $direction, |
| 158 | 158 | array $validDays, |
| 159 | 159 | int $position = 1 |
| 160 | - ): \DateTime|false { |
|
| 160 | + ): \DateTime | false { |
|
| 161 | 161 | if (self::DIRECTION_UP === $direction) { |
| 162 | 162 | $dateTime->setDate((int)$dateTime->format('Y'), (int)$dateTime->format('m'), 1); |
| 163 | 163 | $modify = '+1 day'; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $origId = isset($record['t3ver_oid']) ? (int)$record['t3ver_oid'] : 0; |
| 75 | 75 | $versionState = isset($record['t3ver_state']) ? (int)$record['t3ver_state'] : 0; |
| 76 | 76 | $versionStage = isset($record['t3ver_stage']) ? (int)$record['t3ver_stage'] : 0; |
| 77 | - $neededItems = array_map(static function ($item) use ($workspace, $origId, $record, $versionState, $versionStage) { |
|
| 77 | + $neededItems = array_map(static function($item) use ($workspace, $origId, $record, $versionState, $versionStage) { |
|
| 78 | 78 | $item['t3ver_wsid'] = $workspace; |
| 79 | 79 | $item['t3ver_state'] = $versionState; |
| 80 | 80 | $item['t3ver_stage'] = $versionStage; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | ->executeQuery(); |
| 122 | 122 | |
| 123 | 123 | if ($result->rowCount() > 1) { |
| 124 | - throw new \RuntimeException('Multiple records found for original language record of index '.$record['uid']); |
|
| 124 | + throw new \RuntimeException('Multiple records found for original language record of index ' . $record['uid']); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $originalLanguageRecord = $result->fetchAssociative(); |