From 0a10fe5f225aba725bf7ce9b5c877c2777436555 Mon Sep 17 00:00:00 2001 From: Nikita Hovratov Date: Sat, 9 Mar 2024 18:44:37 +0100 Subject: [PATCH] [TASK] Avoid excessive whitespace --- Classes/DataProcessing/RelationResolver.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Classes/DataProcessing/RelationResolver.php b/Classes/DataProcessing/RelationResolver.php index b88446cb..3725ee01 100644 --- a/Classes/DataProcessing/RelationResolver.php +++ b/Classes/DataProcessing/RelationResolver.php @@ -82,7 +82,6 @@ public function processField( ): mixed { $fieldType = $tcaFieldDefinition->getFieldType(); $recordIdentifier = $tcaFieldDefinition->getUniqueIdentifier(); - if (!array_key_exists($recordIdentifier, $record)) { throw new \RuntimeException( 'The field "' . $recordIdentifier . '" is missing in the "' . $table @@ -90,27 +89,21 @@ public function processField( 1674222293 ); } - $data = $record[$recordIdentifier]; - if ($fieldType === FieldType::FILE) { $fileCollector = GeneralUtility::makeInstance(FileCollector::class); $fileCollector->addFilesFromRelation($table, $recordIdentifier, $record); return $fileCollector->getFiles(); } - if ($fieldType === FieldType::COLLECTION) { return $this->processCollection($table, $record, $tcaFieldDefinition, $typeDefinition); } - if ($fieldType === FieldType::CATEGORY) { return $this->processCategory($tcaFieldDefinition, $typeDefinition, $table, $record); } - if ($fieldType === FieldType::RELATION) { return $this->processRelation($tcaFieldDefinition, $typeDefinition, $table, $record); } - if ($fieldType === FieldType::FOLDER) { $fileCollector = GeneralUtility::makeInstance(FileCollector::class); $folders = GeneralUtility::trimExplode(',', (string)$data, true); @@ -119,22 +112,18 @@ public function processField( $fileCollector->addFilesFromFolders($folders, $folderFieldConfiguration->isRecursive()); return $fileCollector->getFiles(); } - if ($fieldType === FieldType::SELECT) { return $this->processSelect($tcaFieldDefinition, $typeDefinition, $table, $record); } - if ($fieldType === FieldType::FLEXFORM) { return $this->flexFormService->convertFlexFormContentToArray($data); } - if ($fieldType === FieldType::JSON) { $platform = GeneralUtility::makeInstance(ConnectionPool::class) ->getConnectionForTable($table) ->getDatabasePlatform(); return Type::getType('json')->convertToPHPValue($data, $platform); } - return $data; }