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

IlyasDeckers / ody-core / 13548232801

26 Feb 2025 04:06PM UTC coverage: 30.408% (+0.03%) from 30.374%
13548232801

push

github

IlyasDeckers
get host & port from config

0 of 2 new or added lines in 1 file covered. (0.0%)

544 of 1789 relevant lines covered (30.41%)

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