Code Duplication    Length = 22-22 lines in 2 locations

src/Migrations/Migrator.php 2 locations

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