Completed
Push — phpcc-4-5 ( 7d300b...3b90fe )
by Erin
03:00
created

TextCodeCoverageReporter::onRunnerEnd()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
rs 9.6666
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Peridot\Reporter\CodeCoverage;
4
5
use SebastianBergmann\CodeCoverage\Report\Text;
6
7
/**
8
 * Class TextCodeCoverageReporter
9
 * @package Peridot\Reporter\CodeCoverage
10
 */
11
class TextCodeCoverageReporter extends AbstractCodeCoverageReporter
12
{
13
    /**
14
     * @var boolean
15
     */
16
    protected $reportPath = false;
17
18
    /**
19
     * Handle the runner.end event.
20
     */
21
    public function onRunnerEnd()
22
    {
23
        $this->footer();
24
25
        $output = $this->getCoverageReporter()->process($this->coverage, true);
26
        $this->eventEmitter->emit('code-coverage.end', [$this]);
27
28
        $this->output->writeln($output);
29
    }
30
31
    /**
32
     * Create the desired code coverage reporter.
33
     *
34
     * @return Text
35
     */
36
    protected function createCoverageReporter()
37
    {
38
        return new Text(50, 90, true, false);
39
    }
40
}
41