Issues (536)

kahlan-config.php (1 issue)

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');
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) {
0 ignored issues
show
The parameter $next is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

28
Filters::apply($this, 'coverage', function(/** @scrutinizer ignore-unused */ $next) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    if (!extension_loaded('xdebug') && PHP_SAPI !== 'phpdbg') {
30
        return;
31
    }
32
    $reporters = $this->reporters();
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