• 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/Server/Http.php
1
<?php
2

3
namespace Ody\Core\Server;
4

5
use Exception;
6
use Ody\Core\Kernel;
7

8
class Http
9
{
10
    private string $host;
11

12
    private int $port;
13

14
    public function __construct(
×
15
        private readonly int $phpServer
16
    ) {
17
        $this->host = config('server.host');
×
18
        $this->port = config('server.port');
×
19
    }
20

21
    /**
22
     * Starts the server
23
     *
24
     * @param bool $daemonize
25
     * @return void
26
     * @throws Exception
27
     */
28
    public function init(bool $daemonize = false): void
×
29
    {
30
        match($this->phpServer) {
×
31
            // Start a Swoole webserver
NEW
32
            0 => (new \Ody\HttpServer\Server())
×
33
                ->createServer(
×
34
                    Kernel::init(),
×
35
                    $daemonize
×
36
                )->start(),
×
37
            // Start as a normal PHP webserver
38
            1 => exec("php -S {$this->host}:{$this->port} " . __DIR__ . '/init_php_server.php'),
×
39
            default => throw new Exception('Unexpected match value')
×
40
        };
×
41
    }
42
}
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