Code Duplication    Length = 3-4 lines in 3 locations

src/relationships/HasManyRelationship.php 1 location

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

src/relationships/ManyHaveManyRelationship.php 2 locations

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