Code Duplication    Length = 3-4 lines in 3 locations

src/relationships/HasManyRelationship.php 1 location

@@ 45-47 (lines=3) @@
42
43
    public function runSetup()
44
    {
45
        if($this->options['foreign_key'] == null) {
46
            $this->options['foreign_key'] = Text::singularize($this->setupTable) . '_id';
47
        }
48
        if($this->options['local_key'] == null) {
49
            $this->options['local_key'] = $this->setupPrimaryKey[0];
50
        }

src/relationships/ManyHaveManyRelationship.php 2 locations

@@ 72-75 (lines=4) @@
69
            $this->options['local_key'] = $this->setupPrimaryKey[0];
70
        }
71
72
        if (!isset($this->options['junction_local_key'])) {
73
            $this->options['junction_local_key'] = Text::singularize($this->setupTable) . '_id';
74
        }
75
76
        if (!isset($this->options['junction_foreign_key'])) {
77
            $this->options['junction_foreign_key'] = Text::singularize($foreignModel->getDBStoreInformation()['table']) . '_id';
78
        }
@@ 76-78 (lines=3) @@
73
            $this->options['junction_local_key'] = Text::singularize($this->setupTable) . '_id';
74
        }
75
76
        if (!isset($this->options['junction_foreign_key'])) {
77
            $this->options['junction_foreign_key'] = Text::singularize($foreignModel->getDBStoreInformation()['table']) . '_id';
78
        }
79
    }
80
81
}