Passed
Pull Request — develop (#8)
by ANTHONIUS
04:10
created

CoverageEvent::setProcessor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the doyo/behat-coverage-extension 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\Behat\Coverage\Event;
15
16
use Doyo\Behat\Coverage\Bridge\CodeCoverage\ProcessorInterface;
17
use Doyo\Behat\Coverage\Bridge\CodeCoverage\TestCase;
18
use Doyo\Behat\Coverage\Bridge\Symfony\Event;
19
20
class CoverageEvent extends Event
21
{
22
    const BEFORE_START   = 'doyo.coverage.start.pre';
23
    const BEFORE_STOP    = 'doyo.coverage.stop.pre';
24
    const BEFORE_REFRESH = 'doyo.coverage.refresh.pre';
25
    const START          = 'doyo.coverage.start';
26
    const STOP           = 'doyo.coverage.stop';
27
    const REFRESH        = 'doyo.coverage.refresh';
28
    const COMPLETED      = 'doyo.coverage.completed';
29
30
    /**
31
     * @var TestCase
32
     */
33
    private $testCase;
34
35
    /**
36
     * @var ProcessorInterface
37
     */
38
    private $processor;
39
40 6
    public function __construct(TestCase $testCase = null)
41
    {
42 6
        $this->testCase   = $testCase;
43 6
        $this->coverage   = [];
0 ignored issues
show
Bug Best Practice introduced by
The property coverage does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
44 6
    }
45
46
    /**
47
     * @return TestCase
48
     */
49 6
    public function getTestCase()
50
    {
51 6
        return $this->testCase;
52
    }
53
54
    /**
55
     * @param TestCase $testCase
56
     */
57 7
    public function setTestCase($testCase=null)
58
    {
59 7
        $this->testCase = $testCase;
60 7
    }
61
62 8
    public function setProcessor($processor)
63
    {
64 8
        $this->processor = $processor;
65 8
    }
66
67 1
    public function getProcessor()
68
    {
69 1
        return $this->processor;
70
    }
71
}
72