Code Duplication    Length = 6-6 lines in 2 locations

eZ/Publish/Core/Repository/Helper/RelationProcessor.php 2 locations

@@ 119-124 (lines=6) @@
116
        // Map existing relations for easier handling
117
        $mappedRelations = [];
118
        foreach ($existingRelations as $relation) {
119
            if ($relation->type & Relation::FIELD) {
120
                $fieldDefinition = $contentType->getFieldDefinition($relation->sourceFieldDefinitionIdentifier);
121
                if ($fieldDefinition !== null) {
122
                    $mappedRelations[Relation::FIELD][$fieldDefinition->id][$relation->destinationContentInfo->id] = $relation;
123
                }
124
            }
125
126
            if ($relation->type & Relation::ASSET) {
127
                $fieldDefinition = $contentType->getFieldDefinition($relation->sourceFieldDefinitionIdentifier);
@@ 126-131 (lines=6) @@
123
                }
124
            }
125
126
            if ($relation->type & Relation::ASSET) {
127
                $fieldDefinition = $contentType->getFieldDefinition($relation->sourceFieldDefinitionIdentifier);
128
                if ($fieldDefinition !== null) {
129
                    $mappedRelations[Relation::ASSET][$fieldDefinition->id][$relation->destinationContentInfo->id] = $relation;
130
                }
131
            }
132
133
            // Using bitwise AND as Legacy Stack stores COMMON, LINK and EMBED relation types
134
            // in the same entry using bitmask