Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 133-145 (lines=13) @@
130
                    foreach (array_keys($contentIds) as $destinationContentId) {
131
                        if (isset($mappedRelations[$relationType][$fieldDefinitionId][$destinationContentId])) {
132
                            unset($mappedRelations[$relationType][$fieldDefinitionId][$destinationContentId]);
133
                        } else {
134
                            $this->persistenceHandler->contentHandler()->addRelation(
135
                                new SPIRelationCreateStruct(
136
                                    array(
137
                                        'sourceContentId' => $sourceContentId,
138
                                        'sourceContentVersionNo' => $sourceContentVersionNo,
139
                                        'sourceFieldDefinitionId' => $fieldDefinitionId,
140
                                        'destinationContentId' => $destinationContentId,
141
                                        'type' => $relationType,
142
                                    )
143
                                )
144
                            );
145
                        }
146
                    }
147
                }
148
            } elseif ($relationType === Relation::LINK || $relationType === Relation::EMBED) {
@@ 152-164 (lines=13) @@
149
                foreach (array_keys($relationData) as $destinationContentId) {
150
                    if (isset($mappedRelations[$relationType][$destinationContentId])) {
151
                        unset($mappedRelations[$relationType][$destinationContentId]);
152
                    } else {
153
                        $this->persistenceHandler->contentHandler()->addRelation(
154
                            new SPIRelationCreateStruct(
155
                                array(
156
                                    'sourceContentId' => $sourceContentId,
157
                                    'sourceContentVersionNo' => $sourceContentVersionNo,
158
                                    'sourceFieldDefinitionId' => null,
159
                                    'destinationContentId' => $destinationContentId,
160
                                    'type' => $relationType,
161
                                )
162
                            )
163
                        );
164
                    }
165
                }
166
            }
167
        }