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'] = Text::singularize($this->setupTable) . '_id';
93
        }
94
95
        if (!isset($this->options['junction_foreign_key'])) {
96
            $this->options['junction_foreign_key'] = Text::singularize($foreignModel->getDBStoreInformation()['table']) . '_id';
97
        }
@@ 95-97 (lines=3) @@
92
            $this->options['junction_local_key'] = Text::singularize($this->setupTable) . '_id';
93
        }
94
95
        if (!isset($this->options['junction_foreign_key'])) {
96
            $this->options['junction_foreign_key'] = Text::singularize($foreignModel->getDBStoreInformation()['table']) . '_id';
97
        }
98
    }
99
100
    public function preSave(&$wrapper, $value)