Code Duplication    Length = 4-6 lines in 2 locations

src/Laravel/LaravelDatabaseRepository.php 2 locations

@@ 227-232 (lines=6) @@
224
                $data = $this->validateAttributes($data);
225
                if (!$module) {
226
                    $modules[] = $this->getModel()->create($data);
227
                } else {
228
                    // Check version, if version is higher then update module.json into database.
229
                    if (version_compare($module->getVersion(), $data['version'], '<')) {
230
                        $modules[] = $this->getModel()->where(['name' => $data['name']])->update($data);
231
                    }
232
                }
233
            }
234
        }
235
@@ 254-257 (lines=4) @@
251
            }
252
253
            // Check version, if version is higher then update module.json into database.
254
            if (version_compare($module->getVersion(), $data['version'], '<=')) {
255
                $data = $this->validateAttributes($data);
256
                $this->getModel()->where(['name' => $data['name']])->update($data);
257
            }
258
        }
259
260
        parent::update($name);