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

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

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

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

22
        if (! httpServerIsRunning()){
×
23
            $io->error('server is not running...' , true);
×
24
            return self::FAILURE;
×
25
        }
26

27
        if (posix_kill(getMasterProcessId(), SIG_DFL)){
×
28
            posix_kill(getMasterProcessId(), SIGTERM);
×
29
        }
30

31
        if (posix_kill(getManagerProcessId(), SIG_DFL)){
×
32
            posix_kill(getManagerProcessId(), SIGTERM);
×
33
        }
34

35
        if (posix_kill(getWatcherProcessId(), SIG_DFL)){
×
36
            /** @psalm-suppress PossiblyNullArgument */
37
            posix_kill(getWatcherProcessId(), SIGTERM);
×
38
        }
39

40
        foreach (getWorkerProcessIds() as $processId) {
×
41
            if (posix_kill($processId, SIG_DFL)){
×
42
                posix_kill($processId, SIGTERM);
×
43
            }
44
        }
45

46
        sleep(1);
×
47

48
        $io->success('stopping server...' , true);
×
49
        return self::SUCCESS;
×
50
    }
51
}
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