Code Duplication    Length = 8-8 lines in 3 locations

lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php 3 locations

@@ 217-224 (lines=8) @@
214
                    $fkCols = $myFk->getForeignColumns();
215
                    $cols   = $myFk->getColumns();
216
217
                    for ($i = 0, $l = count($cols); $i < $l; $i++) {
218
                        $joinColumn = new Mapping\JoinColumnMetadata();
219
220
                        $joinColumn->setColumnName($cols[$i]);
221
                        $joinColumn->setReferencedColumnName($fkCols[$i]);
222
223
                        $joinTable->addJoinColumn($joinColumn);
224
                    }
225
226
                    $fkCols = $otherFk->getForeignColumns();
227
                    $cols = $otherFk->getColumns();
@@ 229-236 (lines=8) @@
226
                    $fkCols = $otherFk->getForeignColumns();
227
                    $cols = $otherFk->getColumns();
228
229
                    for ($i = 0, $l = count($cols); $i < $l; $i++) {
230
                        $joinColumn = new Mapping\JoinColumnMetadata();
231
232
                        $joinColumn->setColumnName($cols[$i]);
233
                        $joinColumn->setReferencedColumnName($fkCols[$i]);
234
235
                        $joinTable->addInverseJoinColumn($joinColumn);
236
                    }
237
                } else {
238
                    $associationMapping['mappedBy'] = $this->getFieldNameForColumn($manyTable->getName(), current($myFk->getColumns()), true);
239
                }
@@ 468-475 (lines=8) @@
465
                $associationMapping['id'] = true;
466
            }
467
468
            for ($i = 0, $l = count($fkColumns); $i < $l; $i++) {
469
                $joinColumn = new Mapping\JoinColumnMetadata();
470
471
                $joinColumn->setColumnName($fkColumns[$i]);
472
                $joinColumn->setReferencedColumnName($fkForeignColumns[$i]);
473
474
                $associationMapping['joinColumns'][] = $joinColumn;
475
            }
476
477
            // Here we need to check if $fkColumns are the same as $primaryKeys
478
            if ( ! array_diff($fkColumns, $primaryKeys)) {