Passed
Branch master (9c9e82)
by ANTHONIUS
01:35
created

CoverageEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 62
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __call() 0 3 1
A getRuntime() 0 3 1
A __construct() 0 9 1
A getProcessor() 0 3 1
A getConsoleIO() 0 3 1
1
<?php
2
3
4
namespace Doyo\Bridge\CodeCoverage\Event;
5
6
7
use Doyo\Bridge\CodeCoverage\Environment\RuntimeInterface;
8
use Doyo\Bridge\CodeCoverage\ProcessorInterface;
9
use Doyo\Symfony\Bridge\EventDispatcher\Event;
10
use Doyo\Bridge\CodeCoverage\Console\ConsoleIO;
11
12
/**
13
 * Class CoverageEvent
14
 *
15
 * @method bool canCollectCodeCoverage()
16
 * @method string getDriverClass()
17
 */
18
class CoverageEvent extends Event
19
{
20
    const refresh = 'refresh';
21
    const beforeStart = 'beforeStart';
22
    const start = 'start';
23
    const stop = 'stop';
24
    const complete = 'complete';
25
    const report = 'report';
26
27
    /**
28
     * @var ProcessorInterface
29
     */
30
    private $processor;
31
32
    /**
33
     * @var ConsoleIO
34
     */
35
    private $consoleIO;
36
37
    /**
38
     * @var RuntimeInterface
39
     */
40
    private $runtime;
41
42 7
    public function __construct(
43
        ProcessorInterface $processor,
44
        ConsoleIO $consoleIO,
45
        RuntimeInterface $runtime
46
    )
47
    {
48 7
        $this->processor = $processor;
49 7
        $this->consoleIO = $consoleIO;
50 7
        $this->runtime = $runtime;
51
    }
52
53
    /**
54
     * @return ProcessorInterface
55
     */
56 64
    public function getProcessor(): ProcessorInterface
57
    {
58 64
        return $this->processor;
59
    }
60
61
    /**
62
     * @return ConsoleIO
63
     */
64 2
    public function getConsoleIO(): ConsoleIO
65
    {
66 2
        return $this->consoleIO;
67
    }
68
69
    /**
70
     * @return RuntimeInterface
71
     */
72 1
    public function getRuntime(): RuntimeInterface
73
    {
74 1
        return $this->runtime;
75
    }
76
77 64
    public function __call($name, $arguments)
78
    {
79 64
        return call_user_func_array([$this->runtime, $name], $arguments);
80
    }
81
}
82