Code Duplication    Length = 13-13 lines in 2 locations

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

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