Code Duplication    Length = 22-22 lines in 2 locations

src/Migrations/Migrator.php 2 locations

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