Code Duplication    Length = 3-4 lines in 3 locations

src/relationships/HasManyRelationship.php 1 location

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

src/relationships/ManyHaveManyRelationship.php 2 locations

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