Code Duplication    Length = 18-18 lines in 2 locations

src/Phinx/Db/Plan/Plan.php 2 locations

@@ 285-302 (lines=18) @@
282
     * @param \Phinx\Db\Action\Action[] $actions The actions to parse
283
     * @return void
284
     */
285
    protected function gatherTableMoves($actions)
286
    {
287
        collection($actions)
288
            ->filter(function ($action) {
289
                return $action instanceof DropTable
290
                    || $action instanceof RenameTable;
291
            })
292
            ->each(function ($action) {
293
                $table = $action->getTable();
294
                $name = $table->getName();
295
296
                if (!isset($this->tableMoves[$name])) {
297
                    $this->tableMoves[$name] = new AlterTable($table);
298
                }
299
300
                $this->tableMoves[$name]->addAction($action);
301
            });
302
    }
303
304
    /**
305
     * Collects all index creation and drops from the given intent
@@ 340-357 (lines=18) @@
337
     * @param \Phinx\Db\Action\Action[] $actions The actions to parse
338
     * @return void
339
     */
340
    protected function gatherConstraints($actions)
341
    {
342
        collection($actions)
343
            ->filter(function ($action) {
344
                return $action instanceof AddForeignKey
345
                    || $action instanceof DropForeignKey;
346
            })
347
            ->each(function ($action) {
348
                $table = $action->getTable();
349
                $name = $table->getName();
350
351
                if (!isset($this->constraints[$name])) {
352
                    $this->constraints[$name] = new AlterTable($table);
353
                }
354
355
                $this->constraints[$name]->addAction($action);
356
            });
357
    }
358
}
359