Code Duplication    Length = 22-22 lines in 2 locations

src/Migrations/Migrator.php 2 locations

@@ 118-139 (lines=22) @@
115
     *
116
     * @return array
117
     */
118
    public function rollback()
119
    {
120
        $migrations = $this->getLast($this->getMigrations(true));
121
122
        $this->requireFiles($migrations->toArray());
123
124
        $migrated = [];
125
126
        foreach ($migrations as $migration) {
127
            $data = $this->find($migration);
128
129
            if ($data->count()) {
130
                $migrated[] = $migration;
131
132
                $this->down($migration);
133
134
                $data->delete();
135
            }
136
        }
137
138
        return $migrated;
139
    }
140
141
    /**
142
     * Reset migration.
@@ 146-167 (lines=22) @@
143
     *
144
     * @return array
145
     */
146
    public function reset()
147
    {
148
        $migrations = $this->getMigrations(true);
149
150
        $this->requireFiles($migrations);
151
152
        $migrated = [];
153
154
        foreach ($migrations as $migration) {
155
            $data = $this->find($migration);
156
157
            if ($data->count()) {
158
                $migrated[] = $migration;
159
160
                $this->down($migration);
161
162
                $data->delete();
163
            }
164
        }
165
166
        return $migrated;
167
    }
168
169
    /**
170
     * Run down schema from the given migration name.