diff --git a/Classes/Command/CleanUpTransfersCommand.php b/Classes/Command/CleanUpTransfersCommand.php index 5e83575..161113f 100644 --- a/Classes/Command/CleanUpTransfersCommand.php +++ b/Classes/Command/CleanUpTransfersCommand.php @@ -103,7 +103,7 @@ protected function getAgeInDays(InputInterface $input): int ); } - $ageInDays = (int)$ageInDays; + $ageInDays = (int) $ageInDays; if ($ageInDays < 0) { throw new \InvalidArgumentException( \sprintf( diff --git a/Classes/Controller/TableListController.php b/Classes/Controller/TableListController.php index 0584182..9b5e902 100644 --- a/Classes/Controller/TableListController.php +++ b/Classes/Controller/TableListController.php @@ -75,13 +75,13 @@ private function configureDocHeader(string $requestUri): void $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); $newButton = $buttonBar->makeLinkButton() - ->setHref((string)$this->uriBuilder->buildUriFromRoute( + ->setHref((string) $this->uriBuilder->buildUriFromRoute( 'record_edit', [ 'edit' => [ 'tx_jobrouterdata_domain_model_table' => ['new'], ], - 'returnUrl' => (string)$this->uriBuilder->buildUriFromRoute(Extension::MODULE_NAME), + 'returnUrl' => (string) $this->uriBuilder->buildUriFromRoute(Extension::MODULE_NAME), ], )) ->setTitle($this->getLanguageService()->sL(Extension::LANGUAGE_PATH_BACKEND_MODULE . ':action.add_table')) diff --git a/Classes/Controller/TableTestController.php b/Classes/Controller/TableTestController.php index 75f1e2c..5d023b2 100644 --- a/Classes/Controller/TableTestController.php +++ b/Classes/Controller/TableTestController.php @@ -42,7 +42,7 @@ public function __invoke(ServerRequestInterface $request): ResponseInterface return $this->buildResponse('Request has no valid body!'); } - $tableId = (int)$body['tableId']; + $tableId = (int) $body['tableId']; try { try { $table = $this->tableRepository->findByUidWithHidden($tableId); diff --git a/Classes/DataProcessing/TableProcessor.php b/Classes/DataProcessing/TableProcessor.php index 44a9bcb..a9992c4 100644 --- a/Classes/DataProcessing/TableProcessor.php +++ b/Classes/DataProcessing/TableProcessor.php @@ -51,7 +51,7 @@ public function process( $this->processedData = $processedData; $flexForm = $this->flexFormService->convertFlexFormContentToArray($cObj->data['pi_flexform']); - $tableUid = (int)($flexForm['table'] ?? 0); + $tableUid = (int) ($flexForm['table'] ?? 0); if ($tableUid > 0) { $this->enrichProcessedDataWithTableInformation($tableUid); } @@ -67,7 +67,7 @@ private function enrichProcessedDataWithTableInformation(int $tableUid): void // locale is casted to a string as in v12 the locale is an object with a __toString() method (in v11 it is a string) // @todo Remove the cast when compatibility with TYPO3 v11 is dropped - $locale = (string)$this->cObj->getRequest()->getAttribute('language')->getLocale(); + $locale = (string) $this->cObj->getRequest()->getAttribute('language')->getLocale(); $this->processedData['table'] = $tableDemand; $this->processedData['rows'] = $this->datasetConverter->convertFromJsonToArray($table, $locale); $this->addCacheTag($tableUid); diff --git a/Classes/Domain/Entity/Column.php b/Classes/Domain/Entity/Column.php index 98b01fc..b4acd1d 100644 --- a/Classes/Domain/Entity/Column.php +++ b/Classes/Domain/Entity/Column.php @@ -31,14 +31,14 @@ public function __construct( public static function fromArray(array $data): self { return new self( - (int)$data['uid'], + (int) $data['uid'], $data['name'], $data['label'], - (int)$data['type'], - (int)$data['decimal_places'], - (int)$data['field_size'], + (int) $data['type'], + (int) $data['decimal_places'], + (int) $data['field_size'], $data['alignment'], - (int)$data['sorting_priority'], + (int) $data['sorting_priority'], $data['sorting_order'], ); } diff --git a/Classes/Domain/Entity/Dataset.php b/Classes/Domain/Entity/Dataset.php index c0ee6ab..7bcd53e 100644 --- a/Classes/Domain/Entity/Dataset.php +++ b/Classes/Domain/Entity/Dataset.php @@ -33,10 +33,10 @@ private function __construct( public static function fromArray(array $data): self { return new self( - (int)$data['uid'], - (int)$data['table_uid'], - (int)$data['jrid'], - (string)$data['dataset'], + (int) $data['uid'], + (int) $data['table_uid'], + (int) $data['jrid'], + (string) $data['dataset'], ); } } diff --git a/Classes/Domain/Entity/Table.php b/Classes/Domain/Entity/Table.php index 611887b..0a007e9 100644 --- a/Classes/Domain/Entity/Table.php +++ b/Classes/Domain/Entity/Table.php @@ -34,11 +34,11 @@ private function __construct( */ public static function fromArray(array $data): self { - $lastSyncDate = (int)$data['last_sync_date']; + $lastSyncDate = (int) $data['last_sync_date']; return new self( - (int)$data['uid'], - (int)$data['connection'], + (int) $data['uid'], + (int) $data['connection'], TableType::from($data['type']), $data['handle'], $data['name'], @@ -46,8 +46,8 @@ public static function fromArray(array $data): self $data['custom_table'], $data['datasets_sync_hash'], $lastSyncDate > 0 ? (new \DateTimeImmutable())->setTimestamp($lastSyncDate) : null, - (string)$data['last_sync_error'], - (bool)$data['disabled'], + (string) $data['last_sync_error'], + (bool) $data['disabled'], ); } } diff --git a/Classes/Domain/Entity/Transfer.php b/Classes/Domain/Entity/Transfer.php index fe8374c..93e5a9b 100644 --- a/Classes/Domain/Entity/Transfer.php +++ b/Classes/Domain/Entity/Transfer.php @@ -29,17 +29,17 @@ public function __construct( */ public static function fromArray(array $data): self { - $transmitDate = (int)$data['transmit_date']; + $transmitDate = (int) $data['transmit_date']; return new self( - (int)$data['uid'], - (int)$data['crdate'], - (int)$data['table_uid'], + (int) $data['uid'], + (int) $data['crdate'], + (int) $data['table_uid'], $data['correlation_id'], - (string)$data['data'], - (bool)($data['transmit_success'] ?? false), + (string) $data['data'], + (bool) ($data['transmit_success'] ?? false), $transmitDate > 0 ? (new \DateTimeImmutable())->setTimestamp($transmitDate) : null, - (string)$data['transmit_message'], + (string) $data['transmit_message'], ); } } diff --git a/Classes/Domain/Finishers/TransmitDataFinisher.php b/Classes/Domain/Finishers/TransmitDataFinisher.php index 1d6e275..66d22a8 100644 --- a/Classes/Domain/Finishers/TransmitDataFinisher.php +++ b/Classes/Domain/Finishers/TransmitDataFinisher.php @@ -107,7 +107,7 @@ private function prepareData(TableDemand $tableDemand): array $value, ); - $value = $this->resolveFormFields($formValues, (string)$value); + $value = $this->resolveFormFields($formValues, (string) $value); $data[$column] = $this->considerTypeForFieldValue( $value, @@ -137,9 +137,9 @@ private function getTableColumns(TableDemand $table): array private function considerTypeForFieldValue(mixed $value, FieldType $type, int $fieldSize): string|int|float { return match ($type) { - FieldType::Text => $this->cutStringValueToLength((string)$value, $fieldSize), - FieldType::Integer => $value === '' ? '' : (int)$value, - FieldType::Decimal => $value === '' ? '' : (float)$value, + FieldType::Text => $this->cutStringValueToLength((string) $value, $fieldSize), + FieldType::Integer => $value === '' ? '' : (int) $value, + FieldType::Decimal => $value === '' ? '' : (float) $value, FieldType::Date, FieldType::DateTime => throw new InvalidFieldTypeException( \sprintf('The field type "%d" is not implemented in the form finisher', $type->name), diff --git a/Classes/Domain/Repository/TransferRepository.php b/Classes/Domain/Repository/TransferRepository.php index 6fa6e2e..5b2b6d2 100644 --- a/Classes/Domain/Repository/TransferRepository.php +++ b/Classes/Domain/Repository/TransferRepository.php @@ -102,7 +102,7 @@ public function updateTransmitData(int $uid, bool $success, \DateTimeImmutable $ ->update( self::TABLE_NAME, [ - 'transmit_success' => (int)$success, + 'transmit_success' => (int) $success, 'transmit_date' => $date->getTimestamp(), 'transmit_message' => $message, ], diff --git a/Classes/EventListener/DateFormatter.php b/Classes/EventListener/DateFormatter.php index 6488f7f..797daf9 100644 --- a/Classes/EventListener/DateFormatter.php +++ b/Classes/EventListener/DateFormatter.php @@ -23,7 +23,7 @@ public function __invoke(ModifyColumnContentEvent $event): void } $formatter = new \IntlDateFormatter($event->getLocale(), \IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE); - $formattedDate = $formatter->format(new \DateTimeImmutable((string)$event->getContent())); + $formattedDate = $formatter->format(new \DateTimeImmutable((string) $event->getContent())); if ($formattedDate !== false) { $event->setContent($formattedDate); } diff --git a/Classes/EventListener/DateTimeFormatter.php b/Classes/EventListener/DateTimeFormatter.php index d6e5536..305fcf5 100644 --- a/Classes/EventListener/DateTimeFormatter.php +++ b/Classes/EventListener/DateTimeFormatter.php @@ -23,7 +23,7 @@ public function __invoke(ModifyColumnContentEvent $event): void } $formatter = new \IntlDateFormatter($event->getLocale(), \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT); - $formattedDateTime = $formatter->format(new \DateTimeImmutable((string)$event->getContent())); + $formattedDateTime = $formatter->format(new \DateTimeImmutable((string) $event->getContent())); if ($formattedDateTime !== false) { $event->setContent($formattedDateTime); } diff --git a/Classes/EventListener/DecimalFormatter.php b/Classes/EventListener/DecimalFormatter.php index 05333f8..e062c9d 100644 --- a/Classes/EventListener/DecimalFormatter.php +++ b/Classes/EventListener/DecimalFormatter.php @@ -29,7 +29,7 @@ public function __invoke(ModifyColumnContentEvent $event): void } if (\is_string($content) && \is_numeric($content)) { - $content = (float)$content; + $content = (float) $content; } if (\is_string($content)) { diff --git a/Classes/EventListener/IntegerFormatter.php b/Classes/EventListener/IntegerFormatter.php index 16926da..d16eddb 100644 --- a/Classes/EventListener/IntegerFormatter.php +++ b/Classes/EventListener/IntegerFormatter.php @@ -28,7 +28,7 @@ public function __invoke(ModifyColumnContentEvent $event): void } if (\is_string($content) && \is_numeric($content)) { - $content = (int)$content; + $content = (int) $content; } if (\is_string($content)) { diff --git a/Classes/Hooks/TableUpdateHook.php b/Classes/Hooks/TableUpdateHook.php index b536644..f697cd1 100644 --- a/Classes/Hooks/TableUpdateHook.php +++ b/Classes/Hooks/TableUpdateHook.php @@ -31,6 +31,6 @@ public function processCmdmap_postProcess(string $command, string $table, string return; } - $this->datasetRepository->deleteByTableUid((int)$recordId); + $this->datasetRepository->deleteByTableUid((int) $recordId); } } diff --git a/Classes/Preview/ContentElementPreviewRenderer.php b/Classes/Preview/ContentElementPreviewRenderer.php index cfe679b..84b10c0 100644 --- a/Classes/Preview/ContentElementPreviewRenderer.php +++ b/Classes/Preview/ContentElementPreviewRenderer.php @@ -40,14 +40,14 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string $record = $item->getRecord(); $flexForm = GeneralUtility::xml2array($record['pi_flexform']); - $tableId = (int)$this->getValueFromFlexform($flexForm, 'table'); + $tableId = (int) $this->getValueFromFlexform($flexForm, 'table'); try { $table = $this->tableRepository->findByUid($tableId); $site = $this->siteFinder->getSiteByPageId($record['pid']); // locale is casted to a string as in v12 the locale is an object with a __toString() method (in v11 it is a string) // @todo Remove the cast when compatibility with TYPO3 v11 is dropped - $locale = (string)$site->getLanguageById($record['sys_language_uid'])->getLocale(); + $locale = (string) $site->getLanguageById($record['sys_language_uid'])->getLocale(); $view->assignMultiple([ 'tableDemand' => $this->tableDemandFactory->create($table), diff --git a/Classes/Transfer/Transmitter.php b/Classes/Transfer/Transmitter.php index 0214466..4bb6729 100644 --- a/Classes/Transfer/Transmitter.php +++ b/Classes/Transfer/Transmitter.php @@ -91,7 +91,7 @@ private function transmitTransfer(Transfer $transfer): int \json_decode($transfer->data, true, flags: \JSON_THROW_ON_ERROR), ); - return (int)($result[0]['jrid'] ?? 0); + return (int) ($result[0]['jrid'] ?? 0); } private function getTable(int $tableUid): Table diff --git a/Classes/UserFunctions/TCA/Column.php b/Classes/UserFunctions/TCA/Column.php index 51ccef5..a8440b4 100644 --- a/Classes/UserFunctions/TCA/Column.php +++ b/Classes/UserFunctions/TCA/Column.php @@ -22,7 +22,7 @@ final class Column */ public function getLabel(array &$parameters): void { - $label = (string)($parameters['row']['label'] ?? ''); + $label = (string) ($parameters['row']['label'] ?? ''); if (\str_starts_with($label, 'LLL:')) { $label = $this->getLanguageService()->sL($label); } diff --git a/Configuration/TCA/tx_jobrouterdata_domain_model_table.php b/Configuration/TCA/tx_jobrouterdata_domain_model_table.php index ec57985..092520f 100644 --- a/Configuration/TCA/tx_jobrouterdata_domain_model_table.php +++ b/Configuration/TCA/tx_jobrouterdata_domain_model_table.php @@ -173,7 +173,7 @@ ], ], 'types' => [ - (string)TableType::Simple->value => [ + (string) TableType::Simple->value => [ 'columnsOverrides' => [ 'columns' => [ 'config' => [ @@ -202,7 +202,7 @@ description, ', ], - (string)TableType::CustomTable->value => [ + (string) TableType::CustomTable->value => [ 'showitem' => ' type, connection, name, handle, table_guid, custom_table, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, @@ -213,7 +213,7 @@ description, ', ], - (string)TableType::FormFinisher->value => [ + (string) TableType::FormFinisher->value => [ 'showitem' => ' type, connection, name, handle, table_guid, columns, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, @@ -222,7 +222,7 @@ description, ', ], - (string)TableType::OtherUsage->value => [ + (string) TableType::OtherUsage->value => [ 'showitem' => ' type, connection, name, handle, table_guid, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, diff --git a/Tests/Functional/Domain/Repository/TransferRepositoryTest.php b/Tests/Functional/Domain/Repository/TransferRepositoryTest.php index 2e0718d..14c56a7 100644 --- a/Tests/Functional/Domain/Repository/TransferRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/TransferRepositoryTest.php @@ -161,7 +161,7 @@ public function deleteOldSuccessfulTransfers(): void ) ->fetchAllAssociative(); - $availableUids = \array_map(static fn(array $row): int => (int)$row['uid'], $rows); + $availableUids = \array_map(static fn(array $row): int => (int) $row['uid'], $rows); self::assertNotContains(1, $availableUids); self::assertNotContains(3, $availableUids); diff --git a/composer.json b/composer.json index f0b8794..196ea99 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "typo3/cms-frontend": "^11.5.4 || ^12.4" }, "require-dev": { - "brotkrueml/coding-standards": "~5.1.0", + "brotkrueml/coding-standards": "~6.0.0", "codeception/codeception": "^5.1", "codeception/module-asserts": "^3.0", "codeception/module-webdriver": "^4.0",