Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
75.00% covered (warning)
75.00%
3 / 4
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
MigrateTo
75.00% covered (warning)
75.00%
3 / 4
0.00% covered (danger)
0.00%
0 / 1
2.06
0.00% covered (danger)
0.00%
0 / 1
 run
75.00% covered (warning)
75.00%
3 / 4
0.00% covered (danger)
0.00%
0 / 1
2.06
1<?php declare(strict_types=1);
2/*
3 * This file is part of Aplus Framework Dev Commands Library.
4 *
5 * (c) Natan Felles <natanfelles@gmail.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10namespace Framework\CLI\Commands;
11
12use Framework\CLI\CLI;
13
14/**
15 * Class MigrateTo.
16 *
17 * @package dev-commands
18 */
19class MigrateTo extends AbstractMigration
20{
21    protected string $description = 'Runs migrations to a version.';
22
23    public function run() : void
24    {
25        $version = $this->getConsole()->getArgument(0);
26        if ($version === null) {
27            $version = CLI::prompt('Version');
28        }
29        $this->runMigration('to', $version);
30    }
31}