@@ -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 | |
@@ -87,12 +87,12 @@ discard block |
||
| 87 | 87 | $languageField = $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] ?? false; // e.g. sys_language_uid |
| 88 | 88 | $transPointer = $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'] ?? false; // e.g. l10n_parent |
| 89 | 89 | |
| 90 | - if ($transPointer && (int) $record[$transPointer] > 0) { |
|
| 90 | + if ($transPointer && (int)$record[$transPointer] > 0) { |
|
| 91 | 91 | foreach ($neededItems as $key => $value) { |
| 92 | 92 | $originalRecord = BackendUtility::getRecord($value['foreign_table'], $value['foreign_uid']); |
| 93 | 93 | |
| 94 | 94 | $searchFor = $value; |
| 95 | - $searchFor['foreign_uid'] = (int) $originalRecord[$transPointer]; |
|
| 95 | + $searchFor['foreign_uid'] = (int)$originalRecord[$transPointer]; |
|
| 96 | 96 | |
| 97 | 97 | $db = HelperUtility::getDatabaseConnection(IndexerService::TABLE_NAME); |
| 98 | 98 | $q = $db->createQueryBuilder(); |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | if (\is_string($val)) { |
| 102 | 102 | $where[] = $q->expr()->eq($field, $q->quote($val)); |
| 103 | 103 | } else { |
| 104 | - $where[] = $q->expr()->eq($field, (int) $val); |
|
| 104 | + $where[] = $q->expr()->eq($field, (int)$val); |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $result = $q->select('uid')->from(IndexerService::TABLE_NAME)->andWhere(...$where)->execute()->fetch(); |
| 109 | 109 | if (isset($result['uid'])) { |
| 110 | - $neededItems[$key]['l10n_parent'] = (int) $result['uid']; |
|
| 110 | + $neededItems[$key]['l10n_parent'] = (int)$result['uid']; |
|
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - if ($languageField && 0 !== (int) $record[$languageField]) { |
|
| 116 | - $language = (int) $record[$languageField]; |
|
| 115 | + if ($languageField && 0 !== (int)$record[$languageField]) { |
|
| 116 | + $language = (int)$record[$languageField]; |
|
| 117 | 117 | foreach (\array_keys($neededItems) as $key) { |
| 118 | 118 | $neededItems[$key]['sys_language_uid'] = $language; |
| 119 | 119 | } |
@@ -136,16 +136,16 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | $addFields = []; |
| 138 | 138 | if (isset($enableFields['disabled'])) { |
| 139 | - $addFields['hidden'] = (int) $record[$enableFields['disabled']]; |
|
| 139 | + $addFields['hidden'] = (int)$record[$enableFields['disabled']]; |
|
| 140 | 140 | } |
| 141 | 141 | if (isset($enableFields['starttime'])) { |
| 142 | - $addFields['starttime'] = (int) $record[$enableFields['starttime']]; |
|
| 142 | + $addFields['starttime'] = (int)$record[$enableFields['starttime']]; |
|
| 143 | 143 | } |
| 144 | 144 | if (isset($enableFields['endtime'])) { |
| 145 | - $addFields['endtime'] = (int) $record[$enableFields['endtime']]; |
|
| 145 | + $addFields['endtime'] = (int)$record[$enableFields['endtime']]; |
|
| 146 | 146 | } |
| 147 | 147 | if (isset($enableFields['fe_group'])) { |
| 148 | - $addFields['fe_group'] = (string) $record[$enableFields['fe_group']]; |
|
| 148 | + $addFields['fe_group'] = (string)$record[$enableFields['fe_group']]; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | foreach ($neededItems as $key => $value) { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | if ($value instanceof \DateTimeInterface) { |
| 165 | 165 | $record[$key] = $value->getTimestamp(); |
| 166 | 166 | } elseif (\is_bool($value) || 'start_time' === $key || 'end_time' === $key) { |
| 167 | - $record[$key] = (int) $value; |
|
| 167 | + $record[$key] = (int)$value; |
|
| 168 | 168 | } elseif (null === $value) { |
| 169 | 169 | $record[$key] = ''; |
| 170 | 170 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | public function resolve(string $value): ?string |
| 45 | 45 | { |
| 46 | 46 | $route = GeneralUtility::makeInstance(Typo3Route::class); |
| 47 | - $id = (string) $route->convert(['resolve' => $value], null); |
|
| 47 | + $id = (string)$route->convert(['resolve' => $value], null); |
|
| 48 | 48 | |
| 49 | 49 | if ($this->generate($id) !== $value) { |
| 50 | 50 | throw new RouteNotFoundException('Wrong realurl segment', 12378); |
@@ -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,16 +49,16 @@ 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-h-i'; |
| 54 | 54 | $base .= '-' . $index->getStartDateComplete() |
| 55 | 55 | ->format($datePart); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ((bool) ConfigurationUtility::get('addIndexInSpeakingUrl') || \class_exists(PersistedAliasMapper::class)) { |
|
| 58 | + if ((bool)ConfigurationUtility::get('addIndexInSpeakingUrl') || \class_exists(PersistedAliasMapper::class)) { |
|
| 59 | 59 | $base .= '-' . $indexUid; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - return (string) $base; |
|
| 62 | + return (string)$base; |
|
| 63 | 63 | } |
| 64 | 64 | } |
@@ -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,11 +56,11 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function id2alias($value): string |
| 58 | 58 | { |
| 59 | - $alias = (string) $this->getIndexBase((int) $value); |
|
| 59 | + $alias = (string)$this->getIndexBase((int)$value); |
|
| 60 | 60 | |
| 61 | 61 | $slugHelper = GeneralUtility::makeInstance(SlugHelper::class, 'pages', 'uid', []); |
| 62 | 62 | $alias = $slugHelper->sanitize($alias); |
| 63 | 63 | |
| 64 | - return (string) $alias; |
|
| 64 | + return (string)$alias; |
|
| 65 | 65 | } |
| 66 | 66 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $actions = $this->flexFormService->get('switchableControllerActions', 'main'); |
| 66 | 66 | $parts = GeneralUtility::trimExplode(';', $actions, true); |
| 67 | - $parts = \array_map(function ($element) { |
|
| 67 | + $parts = \array_map(function($element) { |
|
| 68 | 68 | $split = \explode('->', $element); |
| 69 | 69 | |
| 70 | 70 | return \ucfirst($split[1]); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $this->layoutService->addRow(TranslateUtility::get('mode'), TranslateUtility::get('mode.' . $actionKey)); |
| 75 | 75 | |
| 76 | - $pluginConfiguration = (int) $this->flexFormService->get('settings.pluginConfiguration', 'main'); |
|
| 76 | + $pluginConfiguration = (int)$this->flexFormService->get('settings.pluginConfiguration', 'main'); |
|
| 77 | 77 | if ($pluginConfiguration) { |
| 78 | 78 | $table = 'tx_calendarize_domain_model_pluginconfiguration'; |
| 79 | 79 | |
@@ -88,17 +88,17 @@ discard block |
||
| 88 | 88 | ); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - if ('' !== \trim((string) $this->flexFormService->get('settings.configuration', 'general'))) { |
|
| 91 | + if ('' !== \trim((string)$this->flexFormService->get('settings.configuration', 'general'))) { |
|
| 92 | 92 | $this->layoutService->addRow( |
| 93 | 93 | TranslateUtility::get('configuration'), |
| 94 | 94 | $this->flexFormService->get('settings.configuration', 'general') |
| 95 | 95 | ); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - if ((bool) $this->flexFormService->get('settings.hidePagination', 'main')) { |
|
| 98 | + if ((bool)$this->flexFormService->get('settings.hidePagination', 'main')) { |
|
| 99 | 99 | $this->layoutService->addRow(TranslateUtility::get('hide.pagination.teaser'), '!!!'); |
| 100 | 100 | } |
| 101 | - $useRelativeDate = (bool) $this->flexFormService->get('settings.useRelativeDate', 'main'); |
|
| 101 | + $useRelativeDate = (bool)$this->flexFormService->get('settings.useRelativeDate', 'main'); |
|
| 102 | 102 | if ($useRelativeDate) { |
| 103 | 103 | $overrideStartRelative = $this->flexFormService->get('settings.overrideStartRelative', 'main'); |
| 104 | 104 | if ($overrideStartRelative) { |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | $this->layoutService->addRow(TranslateUtility::get('override.endrelative'), $overrideEndRelative); |
| 110 | 110 | } |
| 111 | 111 | } else { |
| 112 | - $overrideStartDate = (int) $this->flexFormService->get('settings.overrideStartdate', 'main'); |
|
| 112 | + $overrideStartDate = (int)$this->flexFormService->get('settings.overrideStartdate', 'main'); |
|
| 113 | 113 | if ($overrideStartDate) { |
| 114 | 114 | $this->layoutService->addRow(TranslateUtility::get('override.startdate'), \date('d.m.y H:i', $overrideStartDate)); |
| 115 | 115 | } |
| 116 | - $overrideEndDate = (int) $this->flexFormService->get('settings.overrideEnddate', 'main'); |
|
| 116 | + $overrideEndDate = (int)$this->flexFormService->get('settings.overrideEnddate', 'main'); |
|
| 117 | 117 | if ($overrideEndDate) { |
| 118 | 118 | $this->layoutService->addRow(TranslateUtility::get('override.enddate'), \date('d.m.y H:i', $overrideEndDate)); |
| 119 | 119 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | 'bookingPid', |
| 140 | 140 | ]; |
| 141 | 141 | foreach ($pageIdsNames as $pageIdName) { |
| 142 | - $pageId = (int) $this->flexFormService->get('settings.' . $pageIdName, 'pages'); |
|
| 142 | + $pageId = (int)$this->flexFormService->get('settings.' . $pageIdName, 'pages'); |
|
| 143 | 143 | $pageRow = BackendUtility::getRecord('pages', $pageId); |
| 144 | 144 | if ($pageRow) { |
| 145 | 145 | $this->layoutService->addRow( |
@@ -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\Database\ConnectionPool; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | 75 | foreach ($q->execute()->fetchAll() as $row) { |
| 76 | - $removeIds[] = (int) $row['uid']; |
|
| 76 | + $removeIds[] = (int)$row['uid']; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | if (empty($removeIds)) { |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | ->fetch(); |
| 113 | 113 | |
| 114 | 114 | if (isset($row['value_id'])) { |
| 115 | - return (int) $row['value_id']; |
|
| 115 | + return (int)$row['value_id']; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $matches = []; |
| 119 | 119 | if (\preg_match('/^idx-([0-9]+)$/', $value, $matches)) { |
| 120 | - return (int) $matches[1]; |
|
| 120 | + return (int)$matches[1]; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | return 0; |
@@ -139,17 +139,17 @@ discard block |
||
| 139 | 139 | ->where( |
| 140 | 140 | $q->expr()->andX( |
| 141 | 141 | $q->expr()->eq('tablename', $q->expr()->literal(IndexerService::TABLE_NAME)), |
| 142 | - $q->expr()->eq('value_id', $q->createNamedParameter((int) $value, \PDO::PARAM_INT)) |
|
| 142 | + $q->expr()->eq('value_id', $q->createNamedParameter((int)$value, \PDO::PARAM_INT)) |
|
| 143 | 143 | ) |
| 144 | 144 | ) |
| 145 | 145 | ->execute() |
| 146 | 146 | ->fetch(); |
| 147 | 147 | |
| 148 | 148 | if (isset($row['value_alias'])) { |
| 149 | - return (string) $row['value_alias']; |
|
| 149 | + return (string)$row['value_alias']; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $alias = $this->getIndexBase((int) $value); |
|
| 152 | + $alias = $this->getIndexBase((int)$value); |
|
| 153 | 153 | $alias = $this->cleanUrl($alias); |
| 154 | 154 | $entry = [ |
| 155 | 155 | 'tablename' => IndexerService::TABLE_NAME, |
@@ -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 | /** |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | ->execute() |
| 196 | 196 | ->fetchColumn(0); |
| 197 | 197 | |
| 198 | - return (bool) $count; |
|
| 198 | + return (bool)$count; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $processedTitle = $utility->convertToSafeString($alias); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - return (string) $processedTitle; |
|
| 226 | + return (string)$processedTitle; |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | switch ($configuration->getEndDateDynamic()) { |
| 62 | 62 | case Configuration::END_DYNAMIC_1_DAY: |
| 63 | - $callback = function ($entry) { |
|
| 63 | + $callback = function($entry) { |
|
| 64 | 64 | if ($entry['start_date'] instanceof \DateTime) { |
| 65 | 65 | $entry['end_date'] = clone $entry['start_date']; |
| 66 | 66 | $entry['end_date']->modify('+1 day'); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | }; |
| 71 | 71 | break; |
| 72 | 72 | case Configuration::END_DYNAMIC_1_WEEK: |
| 73 | - $callback = function ($entry) { |
|
| 73 | + $callback = function($entry) { |
|
| 74 | 74 | if ($entry['start_date'] instanceof \DateTime) { |
| 75 | 75 | $entry['end_date'] = clone $entry['start_date']; |
| 76 | 76 | $entry['end_date']->modify('+1 week'); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | }; |
| 81 | 81 | break; |
| 82 | 82 | case Configuration::END_DYNAMIC_END_WEEK: |
| 83 | - $callback = function ($entry) { |
|
| 83 | + $callback = function($entry) { |
|
| 84 | 84 | if ($entry['start_date'] instanceof \DateTime) { |
| 85 | 85 | $entry['end_date'] = clone $entry['start_date']; |
| 86 | 86 | $entry['end_date']->modify('monday next week'); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | }; |
| 92 | 92 | break; |
| 93 | 93 | case Configuration::END_DYNAMIC_END_MONTH: |
| 94 | - $callback = function ($entry) { |
|
| 94 | + $callback = function($entry) { |
|
| 95 | 95 | if ($entry['start_date'] instanceof \DateTime) { |
| 96 | 96 | $entry['end_date'] = clone $entry['start_date']; |
| 97 | 97 | $entry['end_date']->modify('last day of this month'); |
@@ -102,10 +102,10 @@ discard block |
||
| 102 | 102 | break; |
| 103 | 103 | case Configuration::END_DYNAMIC_END_YEAR: |
| 104 | 104 | |
| 105 | - $callback = function ($entry) { |
|
| 105 | + $callback = function($entry) { |
|
| 106 | 106 | if ($entry['start_date'] instanceof \DateTime) { |
| 107 | 107 | $entry['end_date'] = clone $entry['start_date']; |
| 108 | - $entry['end_date']->setDate((int) $entry['end_date']->format('Y'), 12, 31); |
|
| 108 | + $entry['end_date']->setDate((int)$entry['end_date']->format('Y'), 12, 31); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $entry; |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | protected function getFrequencyLimitPerItem(): int |
| 331 | 331 | { |
| 332 | - $maxLimit = (int) ConfigurationUtility::get('frequencyLimitPerItem'); |
|
| 332 | + $maxLimit = (int)ConfigurationUtility::get('frequencyLimitPerItem'); |
|
| 333 | 333 | if ($maxLimit <= 0) { |
| 334 | 334 | $maxLimit = 300; |
| 335 | 335 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | // overlays can connect with l10n_paretn to the right default record. |
| 55 | 55 | $q->select('uid') |
| 56 | 56 | ->from($tableName) |
| 57 | - ->orderBy((string) $transPointer); |
|
| 57 | + ->orderBy((string)$transPointer); |
|
| 58 | 58 | } else { |
| 59 | 59 | $q->select('uid') |
| 60 | 60 | ->from($tableName); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | // Note: "uid" could be e.g. NEW6273482 in DataHandler process |
| 102 | 102 | if (MathUtility::canBeInterpretedAsInteger($uid)) { |
| 103 | - return (int) $this->getCurrentItems($tableName, $uid)->rowCount(); |
|
| 103 | + return (int)$this->getCurrentItems($tableName, $uid)->rowCount(); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | return 0; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $q->expr()->andX( |
| 132 | 132 | $q->expr()->gte('start_date', $now->getTimestamp()), |
| 133 | 133 | $q->expr()->eq('foreign_table', $q->createNamedParameter($table)), |
| 134 | - $q->expr()->eq('foreign_uid', $q->createNamedParameter((int) $uid, \PDO::PARAM_INT)) |
|
| 134 | + $q->expr()->eq('foreign_uid', $q->createNamedParameter((int)$uid, \PDO::PARAM_INT)) |
|
| 135 | 135 | ) |
| 136 | 136 | ) |
| 137 | 137 | ->addOrderBy('start_date', 'ASC') |
@@ -275,9 +275,9 @@ discard block |
||
| 275 | 275 | $q->expr()->notIn('unique_register_key', $validKeys) |
| 276 | 276 | )->execute(); |
| 277 | 277 | |
| 278 | - return (bool) $q->execute(); |
|
| 278 | + return (bool)$q->execute(); |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | - return (bool) $db->truncate(self::TABLE_NAME); |
|
| 281 | + return (bool)$db->truncate(self::TABLE_NAME); |
|
| 282 | 282 | } |
| 283 | 283 | } |