KillCommand::executeAsync()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
namespace Padawan\Command;
4
5
6
use Symfony\Component\Console\Input\InputInterface;
7
use Padawan\Framework\Application\Socket\HttpOutput;
8
use Padawan\Framework\Application;
9
10
class KillCommand extends AsyncCommand
11
{
12
    protected function configure()
13
    {
14
        $this->setName("kill")
15
            ->setDescription("Stops padawan server");
16
    }
17
    protected function executeAsync(InputInterface $input, HttpOutput $output)
18
    {
19
        yield $output->write(json_encode([]));
20
        yield $output->disconnect();
21
        printf("Goodbye\n");
22
        Application::$eventLoop->stop();
23
    }
24
}
25