KillCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 4
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\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