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

IlyasDeckers / ody-core / 13575371463

27 Feb 2025 08:34PM UTC coverage: 28.921% (+0.6%) from 28.348%
13575371463

push

github

IlyasDeckers
Refactoring/cleaning up/getting rid of redundant helper functions

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

9 existing lines in 5 files now uncovered.

544 of 1881 relevant lines covered (28.92%)

8.7 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\Swoole\Http\Server())
×
33
                ->createServer(
×
NEW
34
                    Kernel::init(),
×
NEW
35
                    $daemonize
×
NEW
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