Code Duplication    Length = 22-22 lines in 2 locations

src/Migrations/Migrator.php 2 locations

@@ 95-116 (lines=22) @@
92
     *
93
     * @return array
94
     */
95
    public function rollback()
96
    {
97
        $migrations = $this->getLast($this->getMigrations(true));
98
99
        $this->requireFiles($migrations->toArray());
100
101
        $migrated = [];
102
103
        foreach ($migrations as $migration) {
104
            $data = $this->find($migration);
105
106
            if ($data->count()) {
107
                $migrated[] = $migration;
108
109
                $this->down($migration);
110
111
                $data->delete();
112
            }
113
        }
114
115
        return $migrated;
116
    }
117
118
    /**
119
     * Reset migration.
@@ 123-144 (lines=22) @@
120
     *
121
     * @return array
122
     */
123
    public function reset()
124
    {
125
        $migrations = $this->getMigrations(true);
126
127
        $this->requireFiles($migrations);
128
129
        $migrated = [];
130
131
        foreach ($migrations as $migration) {
132
            $data = $this->find($migration);
133
134
            if ($data->count()) {
135
                $migrated[] = $migration;
136
137
                $this->down($migration);
138
139
                $data->delete();
140
            }
141
        }
142
143
        return $migrated;
144
    }
145
146
    /**
147
     * Run down schema from the given migration name.