Code Duplication    Length = 3-4 lines in 3 locations

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

src/relationships/HasManyRelationship.php 1 location

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