Issues (536)

kahlan-config.php (2 issues)

1
<?php
2
use Kahlan\Filter\Filters;
3
use Kahlan\Reporter\Coverage;
4
use Kahlan\Reporter\Coverage\Driver\Xdebug;
5
use Kahlan\Reporter\Coverage\Driver\Phpdbg;
6
use Kahlan\Reporter\Coverage\Exporter\Clover;
7
8
$commandLine = $this->commandLine();
9
$commandLine->option('ff', 'default', 1);
10
$commandLine->option('coverage-scrutinizer', 'default', 'scrutinizer.xml');
11
12
Filters::apply($this, 'reporting', function($next) {
13
14
    $reporter = $this->reporters()->get('coverage');
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
15
16
    if (!$reporter || !$this->commandLine()->exists('coverage-scrutinizer')) {
17
        return $next();
18
    }
19
20
    Clover::write([
21
        'collector' => $reporter,
22
        'file' => $this->commandLine()->get('coverage-scrutinizer'),
23
    ]);
24
25
    return $next();
26
});
27
28
Filters::apply($this, 'coverage', function($next) {
29
    if (!extension_loaded('xdebug') && PHP_SAPI !== 'phpdbg') {
30
        return;
31
    }
32
    $reporters = $this->reporters();
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
33
    $coverage = new Coverage([
34
        'verbosity' => $this->commandLine()->get('coverage'),
35
        'driver'    => PHP_SAPI !== 'phpdbg' ? new Xdebug() : new Phpdbg(),
36
        'path'      => $this->commandLine()->get('src'),
37
        'colors'    => !$this->commandLine()->get('no-colors')
38
    ]);
39
    $reporters->add('coverage', $coverage);
40
});
41
42
require_once realpath(rtrim(getcwd(), '\\/ ')) . DIRECTORY_SEPARATOR . 'spec' . DIRECTORY_SEPARATOR . 'bootstrap.php';
43