• 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/SeedCommand.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 SeedCommand extends LoggerAdapter
10
{
NEW
11
    public function __construct()
×
12
    {
NEW
13
        $this->table = "rudra_seeds";
×
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(str_replace('/', DIRECTORY_SEPARATOR, Rudra::config()->get('app.path') . "/app/Containers/" . $container . "/Seed/")), 2);
×
NEW
24
            $namespace = "App\\Containers\\$container\\Seed\\";
×
25
        } else {
NEW
26
            $fileList  = array_slice(scandir(str_replace('/', DIRECTORY_SEPARATOR, Rudra::config()->get('app.path') . "/app/Ship/Seed/")), 2);
×
NEW
27
            $namespace = "App\\Ship\\Seed\\";
×
28
        }
29

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

NEW
34
        foreach ($fileList as $filename) {
×
35

NEW
36
            $seedName = $namespace . strstr($filename, '.', true);
×
37

NEW
38
            if ($seedName === 'App\Ship\Seed\AbstractSeed') {
×
NEW
39
                continue;
×
40
            }
41

NEW
42
            if ($this->checkLog($seedName)) {
×
NEW
43
                Cli::printer("⚠️  $seedName was seeded" . PHP_EOL, "light_yellow");
×
44
            } else {
NEW
45
                (new $seedName)->create();
×
NEW
46
                Cli::printer("✅  $seedName seeded successfully" . PHP_EOL, "light_green");
×
NEW
47
                $this->writeLog($seedName);
×
48
            }
49
        }
50
    }
51
}
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