• 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/Console/Commands/Websockets/StopCommand.php
1
<?php
2
declare(strict_types=1);
3

4
namespace Ody\Core\Console\Commands\Websockets;
5

6
use Ody\Core\Console\Style;
7
use Ody\Swoole\ServerState;
8
use Symfony\Component\Console\Attribute\AsCommand;
9
use Symfony\Component\Console\Command\Command;
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12

13
#[AsCommand(
14
    name: 'websocket:stop' ,
×
15
    description: 'stop websocket server')
×
16
]
×
17
class StopCommand extends Command
18
{
19
    protected function execute(InputInterface $input, OutputInterface $output): int
×
20
    {
NEW
21
        $serverState = ServerState::getInstance();
×
UNCOV
22
        $io = new Style($input, $output);
×
23

NEW
24
        if (!$serverState->websocketServerIsRunning()){
×
25
            $io->error('server is not running...' , true);
×
26
            return self::FAILURE;
×
27
        }
28

NEW
29
        $serverState->killProcesses([
×
NEW
30
            $serverState->getWebsocketMasterProcessId(),
×
NEW
31
            $serverState->getWebsocketManagerProcessId(),
×
NEW
32
            $serverState->getWatcherProcessId(),
×
NEW
33
            ...$serverState->getWebsocketWorkerProcessIds()
×
NEW
34
        ]);
×
35

NEW
36
        $serverState->clearWebsocketProcessIds();
×
37

38

UNCOV
39
        sleep(1);
×
40

41
        $io->success('Stopped websocket server...' , true);
×
42
        return self::SUCCESS;
×
43
    }
44
}
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