Completed
Push — master ( 5bda77...cb2c73 )
by Aleh
10s
created

KillCommand::executeAsync()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
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\SocketOutput;
8
use Amp;
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, SocketOutput $output)
18
    {
19
        yield $output->write(json_encode([]));
20
        yield $output->disconnect();
21
        printf("Goodbye\n");
22
        yield Amp\stop();
23
    }
24
}
25