LiveReporter::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace whm\Smoke\Extensions\SmokeReporter\Reporter;
4
5
use Symfony\Component\Console\Output\OutputInterface;
6
use whm\Smoke\Scanner\Result;
7
8
class LiveReporter extends CliReporter
0 ignored issues
show
Bug introduced by
There is one abstract method processResults in this class; you could implement it, or declare this class as abstract.
Loading history...
9
{
10
    public function init(OutputInterface $_output)
11
    {
12
        $this->setOutputInterface($_output);
13
    }
14
15
    public function processResult(Result $result)
16
    {
17
        if ($result->isSuccess()) {
18
            $this->renderSuccess($result);
0 ignored issues
show
Documentation introduced by
$result is of type object<whm\Smoke\Scanner\Result>, but the function expects a object<whm\Smoke\Rules\CheckResult>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
19
        } else {
20
            $this->renderFailure($result);
0 ignored issues
show
Documentation introduced by
$result is of type object<whm\Smoke\Scanner\Result>, but the function expects a object<whm\Smoke\Rules\CheckResult>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
21
        }
22
    }
23
24
    public function finish()
25
    {
26
    }
27
}
28