Code Duplication    Length = 7-8 lines in 2 locations

typo3/sysext/backend/Classes/Form/FormDataProvider/EvaluateDisplayConditions.php 2 locations

@@ 476-482 (lines=7) @@
473
                }
474
                $sheetName = $flexContext['sheetNameFieldNames'][$givenFieldName]['sheetName'];
475
                $fieldName = $flexContext['sheetNameFieldNames'][$givenFieldName]['fieldName'];
476
                if (!isset($flexContext['flexFormRowData']['data'][$sheetName]['lDEF'][$fieldName]['vDEF'])) {
477
                    throw new \RuntimeException(
478
                        'Flex form displayCond on sheet "' . $flexContext['currentSheetName'] . '" references field "' . $fieldName
479
                        . '" of sheet "' . $sheetName . '", but that field does not exist in current data structure',
480
                        1481488492
481
                    );
482
                }
483
                $fieldValue = $flexContext['flexFormRowData']['data'][$sheetName]['lDEF'][$fieldName]['vDEF'];
484
            }
485
        } elseif ($flexContext['context'] === 'flexField') {
@@ 501-508 (lines=8) @@
498
                if (in_array($givenFieldName, $listOfLocalFlexFieldNames, true)) {
499
                    // Condition references field name of the same sheet
500
                    $sheetName = $flexContext['currentSheetName'];
501
                    if (!isset($flexContext['flexFormRowData']['data'][$sheetName]['lDEF'][$givenFieldName]['vDEF'])) {
502
                        throw new \RuntimeException(
503
                            'Flex form displayCond on field "' . $flexContext['currentFieldName'] . '" on flex form sheet "'
504
                            . $flexContext['currentSheetName'] . '" references field "' . $givenFieldName . '", but a field value'
505
                            . ' does not exist in this sheet',
506
                            1481492953
507
                        );
508
                    }
509
                    $fieldValue = $flexContext['flexFormRowData']['data'][$sheetName]['lDEF'][$givenFieldName]['vDEF'];
510
                } elseif (in_array($givenFieldName, array_keys($flexContext['sheetNameFieldNames'], true))) {
511
                    // Condition references field name including a sheet name