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

IlyasDeckers / ody-core / 13587002861

28 Feb 2025 11:15AM UTC coverage: 33.13% (+4.2%) from 28.921%
13587002861

push

github

IlyasDeckers
mv commands to packages

0 of 8 new or added lines in 2 files covered. (0.0%)

544 of 1642 relevant lines covered (33.13%)

9.96 hits per line

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

0.0
/src/Console/Console.php
1
<?php
2
declare (strict_types = 1);
3
namespace Ody\Core\Console;
4

5
use Composer\ClassMapGenerator\ClassMapGenerator;
6
use Ody\Core\Env;
7
use Symfony\Component\Console\Application;
8
use Exception;
9

10
final class Console
11
{
12
    /**
13
     * @throws Exception
14
     */
15
    public static function init(): void
×
16
    {
17
        Env::load('./');
×
18
        $application = new Application();
×
19
        $application->addCommands(
×
20
            (new Console())->generateCommandsClassMap()
×
21
        );
×
22
        $application->run();
×
23
    }
24

25
    private function generateCommandsClassMap(): array
×
26
    {
27
        $classMapGenerator = new ClassMapGenerator;
×
28
        $classMapGenerator->scanPaths('App/Console/Commands');
×
29
        $classMapGenerator->scanPaths(__dir__ . '/Commands');
×
30
        $classMapGenerator = $classMapGenerator->getClassMap();
×
31

32
        $classMap = [];
×
33
        foreach (array_keys($classMapGenerator->getMap()) as $class) {
×
34
            $classMap[] = new $class();
×
35
        }
36

37
        if (class_exists('Ody\DB\Migrations\Command\StatusCommand')) {
×
38
            $classMap[] = new \Ody\DB\Migrations\Command\StatusCommand('migrations:status');
×
39
            $classMap[] = new \Ody\DB\Migrations\Command\MigrateCommand('migrations:run');
×
40
            $classMap[] = new \Ody\DB\Migrations\Command\CleanupCommand('migrations:clear');
×
41
            $classMap[] = new \Ody\DB\Migrations\Command\DumpCommand('migrations:dump');
×
42
            $classMap[] = new \Ody\DB\Migrations\Command\InitCommand('migrations:init');
×
43
            $classMap[] = new \Ody\DB\Migrations\Command\RollbackCommand('migrations:rollback');
×
44
            $classMap[] = new \Ody\DB\Migrations\Command\StatusCommand('migrations:status');
×
45
            $classMap[] = new \Ody\DB\Migrations\Command\CreateCommand('migrations:create');
×
46
            $classMap[] = new \Ody\DB\Migrations\Command\DiffCommand('migrations:diff');
×
47
        }
48

NEW
49
        if (class_exists('Ody\Websocket\Commands\StartCommand')) {
×
NEW
50
            $classMap[] = new \Ody\Websocket\Commands\StartCommand();
×
NEW
51
            $classMap[] = new \Ody\Websocket\Commands\StopCommand();
×
52
        }
53

NEW
54
        if (class_exists('Ody\HttpServer\Commands\StartCommand')) {
×
NEW
55
            $classMap[] = new \Ody\HttpServer\Commands\StartCommand();
×
NEW
56
            $classMap[] = new \Ody\HttpServer\Commands\StopCommand();
×
NEW
57
            $classMap[] = new \Ody\HttpServer\Commands\ReloadCommand();
×
58
        }
59

60
        return $classMap;
×
61
    }
62
}
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