Code Duplication    Length = 3-4 lines in 3 locations

src/relationships/HasManyRelationship.php 1 location

@@ 51-53 (lines=3) @@
48
49
    public function runSetup()
50
    {
51
        if($this->options['foreign_key'] == null) {
52
            $this->options['foreign_key'] = Text::singularize($this->setupTable) . '_id';
53
        }
54
        if($this->options['local_key'] == null) {
55
            $this->options['local_key'] = $this->setupPrimaryKey[0];
56
        }

src/relationships/ManyHaveManyRelationship.php 2 locations

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