Completed
Push — master ( 4f2fad...dd1cd3 )
by Guillaume
07:10
created

RunHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 6 1
1
<?php
2
3
namespace Hogosha\Monitor\Console\Handler;
4
5
use Hogosha\Monitor\Renderer\RendererFactory;
6
use Hogosha\Monitor\Runner\Runner;
7
use Webmozart\Console\Adapter\IOOutput;
8
use Webmozart\Console\Api\Args\Args;
9
use Webmozart\Console\Api\Command\Command;
10
use Webmozart\Console\Api\IO\IO;
11
12
/**
13
 * @author Guillaume Cavana <[email protected]>
14
 */
15
class RunHandler
16
{
17
    /**
18
     * $runner.
19
     * @var Runner
20
     */
21
    protected $runner;
22
23
    /**
24
     * Constructor.
25
     * @param Runner $runner
26
     */
27
    public function __construct(Runner $runner)
28
    {
29
        $this->runner = $runner;
30
    }
31
32
    /**
33
     * handle.
34
     * @param  Args    $args
35
     * @param  IO      $io
36
     * @param  Command $command
37
     * @return string
38
     */
39
    public function handle(Args $args, IO $io, Command $command)
0 ignored issues
show
Unused Code introduced by
The parameter $command is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
    {
41
        $renderer = RendererFactory::create($args->getOption('format'), $io);
42
        $results = $this->runner->run();
43
        $renderer->render($results);
44
    }
45
}
46