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

RunHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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