Code Duplication    Length = 17-17 lines in 2 locations

eZ/Publish/Core/Repository/ContentService.php 2 locations

@@ 572-588 (lines=17) @@
569
570
                $fieldValue = $fieldType->acceptValue($fieldValue);
571
572
                if ($fieldType->isEmptyValue($fieldValue)) {
573
                    $isEmptyValue = true;
574
                    if ($fieldDefinition->isRequired) {
575
                        throw new ContentValidationException(
576
                            "Value for required field definition '%identifier%' with language '%languageCode%' is empty",
577
                            ['%identifier%' => $fieldDefinition->identifier, '%languageCode%' => $languageCode]
578
                        );
579
                    }
580
                } else {
581
                    $fieldErrors = $fieldType->validate(
582
                        $fieldDefinition,
583
                        $fieldValue
584
                    );
585
                    if (!empty($fieldErrors)) {
586
                        $allFieldErrors[$fieldDefinition->id][$languageCode] = $fieldErrors;
587
                    }
588
                }
589
590
                if (!empty($allFieldErrors)) {
591
                    continue;
@@ 1216-1232 (lines=17) @@
1213
1214
                $fieldValue = $fieldType->acceptValue($fieldValue);
1215
1216
                if ($fieldType->isEmptyValue($fieldValue)) {
1217
                    $isEmpty = true;
1218
                    if ($fieldDefinition->isRequired) {
1219
                        throw new ContentValidationException(
1220
                            "Value for required field definition '%identifier%' with language '%languageCode%' is empty",
1221
                            ['%identifier%' => $fieldDefinition->identifier, '%languageCode%' => $languageCode]
1222
                        );
1223
                    }
1224
                } else {
1225
                    $fieldErrors = $fieldType->validate(
1226
                        $fieldDefinition,
1227
                        $fieldValue
1228
                    );
1229
                    if (!empty($fieldErrors)) {
1230
                        $allFieldErrors[$fieldDefinition->id][$languageCode] = $fieldErrors;
1231
                    }
1232
                }
1233
1234
                if (!empty($allFieldErrors)) {
1235
                    continue;