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

IlyasDeckers / ody-core / 13532154862

25 Feb 2025 10:24PM UTC coverage: 30.374% (+1.7%) from 28.706%
13532154862

push

github

web-flow
Update php.yml

544 of 1791 relevant lines covered (30.37%)

9.13 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 Ody\Core\Console\Style;
6
use Ody\Core\Kernel;
7
use Swoole\Http\Server;
8

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

13
    private int $port;
14

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

22
    /**
23
     * Starts the server
24
     *
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
32
            0 => (new \Ody\Swoole\Http())
×
33
                ->createServer(
×
34
                    Kernel::init(),
×
35
                    $this->host,
×
36
                    $this->port
×
37
                )->start($daemonize),
×
38
            // Start as a normal PHP webserver
39
            1 => exec("php -S {$this->host}:{$this->port} " . __DIR__ . '/init_php_server.php'),
×
40
            default => throw new \Exception('Unexpected match value')
×
41
        };
×
42
    }
43
}
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