Code Duplication    Length = 3-4 lines in 3 locations

src/relationships/HasManyRelationship.php 1 location

@@ 57-59 (lines=3) @@
54
55
    public function runSetup()
56
    {
57
        if($this->options['foreign_key'] == null) {
58
            $this->options['foreign_key'] = Text::singularize($this->setupTable) . '_id';
59
        }
60
        if($this->options['local_key'] == null) {
61
            $this->options['local_key'] = $this->setupPrimaryKey[0];
62
        }

src/relationships/ManyHaveManyRelationship.php 2 locations

@@ 88-91 (lines=4) @@
85
            $this->options['local_key'] = $this->setupPrimaryKey[0];
86
        }
87
88
        if (!isset($this->options['junction_local_key'])) {
89
            $this->options['junction_local_key'] = 
90
                Text::singularize($this->setupTable) . '_id';
91
        }
92
93
        if (!isset($this->options['junction_foreign_key'])) {
94
            $this->options['junction_foreign_key'] = 
@@ 93-95 (lines=3) @@
90
                Text::singularize($this->setupTable) . '_id';
91
        }
92
93
        if (!isset($this->options['junction_foreign_key'])) {
94
            $this->options['junction_foreign_key'] = 
95
                Text::singularize($foreignModel->getDBStoreInformation()['table']) . '_id';
96
        }
97
    }
98