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

KillCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 2
c 3
b 0
f 2
lcom 0
cbo 3
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 5 1
A executeAsync() 0 7 1
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