CoverageEvent::__call()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the doyo/code-coverage project.
5
 *
6
 * (c) Anthonius Munthi <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Doyo\Bridge\CodeCoverage\Event;
15
16
use Doyo\Bridge\CodeCoverage\Console\ConsoleIO;
17
use Doyo\Bridge\CodeCoverage\Environment\RuntimeInterface;
18
use Doyo\Bridge\CodeCoverage\ProcessorInterface;
19
use Doyo\Symfony\Bridge\EventDispatcher\Event;
0 ignored issues
show
Bug introduced by
The type Doyo\Symfony\Bridge\EventDispatcher\Event was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
21
/**
22
 * Class CoverageEvent.
23
 *
24
 * @method bool   canCollectCodeCoverage()
25
 * @method string getDriverClass()
26
 */
27
class CoverageEvent extends Event
28
{
29
    const refresh     = 'refresh';
30
    const beforeStart = 'beforeStart';
31
    const start       = 'start';
32
    const stop        = 'stop';
33
    const complete    = 'complete';
34
    const report      = 'report';
35
36
    /**
37
     * @var ProcessorInterface
38
     */
39
    private $processor;
40
41
    /**
42
     * @var ConsoleIO
43
     */
44
    private $consoleIO;
45
46
    /**
47
     * @var RuntimeInterface
48
     */
49
    private $runtime;
50
51
    public function __construct(
52
        ProcessorInterface $processor,
53
        ConsoleIO $consoleIO,
54
        RuntimeInterface $runtime
55
    ) {
56
        $this->processor = $processor;
57
        $this->consoleIO = $consoleIO;
58
        $this->runtime   = $runtime;
59
    }
60
61
    /**
62
     * @return ProcessorInterface
63
     */
64
    public function getProcessor(): ProcessorInterface
65
    {
66
        return $this->processor;
67
    }
68
69
    /**
70
     * @return ConsoleIO
71
     */
72
    public function getConsoleIO(): ConsoleIO
73
    {
74
        return $this->consoleIO;
75
    }
76
77
    /**
78
     * @return RuntimeInterface
79
     */
80
    public function getRuntime(): RuntimeInterface
81
    {
82
        return $this->runtime;
83
    }
84
85
    public function __call($name, $arguments)
86
    {
87
        return \call_user_func_array([$this->runtime, $name], $arguments);
88
    }
89
}
90