• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Jagepard / Rudra-Cli / 15920986328

27 Jun 2025 07:42AM UTC coverage: 4.771% (-95.2%) from 100.0%
15920986328

push

github

web-flow
Merge pull request #29 from Jagepard/wip

adds commands

0 of 479 new or added lines in 20 files covered. (0.0%)

24 of 503 relevant lines covered (4.77%)

0.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Command/MigrateCommand.php
1
<?php
2

3
namespace Rudra\Cli\Command;
4

5
use Rudra\Container\Facades\Rudra;
6
use Rudra\Cli\Command\ConsoleFacade as Cli;
7
use App\Ship\Utils\Database\LoggerAdapter;
8

9
class MigrateCommand extends LoggerAdapter
10
{
NEW
11
    public function __construct()
×
12
    {
NEW
13
        $this->table = "rudra_migrations";
×
NEW
14
        parent::__construct();
×
15
    }
16

NEW
17
    public function actionIndex(): void
×
18
    {
NEW
19
        Cli::printer("Enter container (empty for Ship): ", "magneta");
×
NEW
20
        $container = ucfirst(str_replace(PHP_EOL, "", Cli::reader()));
×
21

NEW
22
        if (!empty($container)) {
×
NEW
23
            $fileList  = array_slice(scandir(Rudra::config()->get('app.path') . "/app/Containers/" . $container . "/Migration/"), 2);
×
NEW
24
            $namespace = "App\\Containers\\$container\\Migration\\";
×
25
        } else {
NEW
26
            $fileList  = array_slice(scandir(Rudra::config()->get('app.path') . "/app/Ship/Migration/"), 2);
×
NEW
27
            $namespace = "App\\Ship\\Migration\\";
×
28
        }
29

30

NEW
31
        if (!$this->isTable()) {
×
NEW
32
            $this->up();
×
33
        }
34

NEW
35
        foreach ($fileList as $filename) {
×
NEW
36
            $migrationName = $namespace . strstr($filename, '.', true);
×
37

NEW
38
            if ($this->checkLog($migrationName)) {
×
NEW
39
                Cli::printer("⚠️  $migrationName was migrated" . PHP_EOL, "light_yellow");
×
40
            } else {
NEW
41
                (new $migrationName)->up();
×
NEW
42
                Cli::printer("✅ $migrationName migrated successfully" . PHP_EOL, "light_green");
×
NEW
43
                $this->writeLog($migrationName);
×
44
            }
45
        }
46
    }
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc