Code Duplication    Length = 8-10 lines in 2 locations

lib/Doctrine/ORM/Tools/SchemaTool.php 2 locations

@@ 233-242 (lines=10) @@
230
                            );
231
232
                            foreach ($idMapping['joinColumns'] as $joinColumn) {
233
                                if (isset($targetEntity->fieldMappings[$joinColumn['referencedColumnName']])) {
234
                                    $columnName = $this->quoteStrategy->getJoinColumnName(
235
                                        $joinColumn,
236
                                        $class,
237
                                        $this->platform
238
                                    );
239
240
                                    $pkColumns[]           = $columnName;
241
                                    $inheritedKeyColumns[] = $columnName;
242
                                }
243
                            }
244
                        }
245
                    }
@@ 276-283 (lines=8) @@
273
            foreach ($class->identifier as $identifierField) {
274
                if (isset($class->fieldMappings[$identifierField])) {
275
                    $pkColumns[] = $this->quoteStrategy->getColumnName($identifierField, $class, $this->platform);
276
                } elseif (isset($class->associationMappings[$identifierField])) {
277
                    /* @var $assoc \Doctrine\ORM\Mapping\OneToOne */
278
                    $assoc = $class->associationMappings[$identifierField];
279
280
                    foreach ($assoc['joinColumns'] as $joinColumn) {
281
                        $pkColumns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
282
                    }
283
                }
284
            }
285
286
            if ( ! $table->hasIndex('primary')) {