Code Duplication    Length = 8-8 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RelationConverter.php 1 location

@@ 76-83 (lines=8) @@
73
        $doc->appendChild($root);
74
75
        $constraints = $doc->createElement('constraints');
76
        if (!empty($fieldSettings['selectionContentTypes'])) {
77
            foreach ($fieldSettings['selectionContentTypes'] as $typeIdentifier) {
78
                $allowedClass = $doc->createElement('allowed-class');
79
                $allowedClass->setAttribute('contentclass-identifier', $typeIdentifier);
80
                $constraints->appendChild($allowedClass);
81
                unset($allowedClass);
82
            }
83
        }
84
        $root->appendChild($constraints);
85
86
        $selectionType = $doc->createElement('selection_type');

eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.php 1 location

@@ 125-132 (lines=8) @@
122
        $doc->appendChild($root);
123
124
        $constraints = $doc->createElement('constraints');
125
        if (!empty($fieldSettings['selectionContentTypes'])) {
126
            foreach ($fieldSettings['selectionContentTypes'] as $typeIdentifier) {
127
                $allowedClass = $doc->createElement('allowed-class');
128
                $allowedClass->setAttribute('contentclass-identifier', $typeIdentifier);
129
                $constraints->appendChild($allowedClass);
130
                unset($allowedClass);
131
            }
132
        }
133
        $root->appendChild($constraints);
134
135
        $type = $doc->createElement('type');