Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 146-158 (lines=13) @@
143
                    foreach (array_keys($contentIds) as $destinationContentId) {
144
                        if (isset($mappedRelations[$relationType][$fieldDefinitionId][$destinationContentId])) {
145
                            unset($mappedRelations[$relationType][$fieldDefinitionId][$destinationContentId]);
146
                        } else {
147
                            $this->persistenceHandler->contentHandler()->addRelation(
148
                                new SPIRelationCreateStruct(
149
                                    array(
150
                                        'sourceContentId' => $sourceContentId,
151
                                        'sourceContentVersionNo' => $sourceContentVersionNo,
152
                                        'sourceFieldDefinitionId' => $fieldDefinitionId,
153
                                        'destinationContentId' => $destinationContentId,
154
                                        'type' => $relationType,
155
                                    )
156
                                )
157
                            );
158
                        }
159
                    }
160
                }
161
            } elseif ($relationType === Relation::LINK || $relationType === Relation::EMBED) {
@@ 165-177 (lines=13) @@
162
                foreach (array_keys($relationData) as $destinationContentId) {
163
                    if (isset($mappedRelations[$relationType][$destinationContentId])) {
164
                        unset($mappedRelations[$relationType][$destinationContentId]);
165
                    } else {
166
                        $this->persistenceHandler->contentHandler()->addRelation(
167
                            new SPIRelationCreateStruct(
168
                                array(
169
                                    'sourceContentId' => $sourceContentId,
170
                                    'sourceContentVersionNo' => $sourceContentVersionNo,
171
                                    'sourceFieldDefinitionId' => null,
172
                                    'destinationContentId' => $destinationContentId,
173
                                    'type' => $relationType,
174
                                )
175
                            )
176
                        );
177
                    }
178
                }
179
            }
180
        }