RunnerTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 41
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testAdditionalReporters() 0 30 1
A createMockReporter() 0 4 1
1
<?php
2
3
namespace Liip\MonitorBundle\Tests;
4
5
use Laminas\Diagnostics\Runner\Reporter\ReporterInterface;
6
use Liip\MonitorBundle\Runner;
7
8
/**
9
 * @author Kevin Bond <[email protected]>
10
 */
11
class RunnerTest extends \PHPUnit\Framework\TestCase
12
{
13
    public function testAdditionalReporters()
14
    {
15
        $runner = new Runner();
16
17
        $this->assertCount(0, $runner->getReporters());
0 ignored issues
show
Documentation introduced by
$runner->getReporters() is of type array|object<Traversable>, but the function expects a object<Countable>|object...nit\Framework\iterable>.

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...
18
19
        $runner->addAdditionalReporter('foo', $this->createMockReporter());
0 ignored issues
show
Documentation introduced by
$this->createMockReporter() is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Laminas\Diagnosti...rter\ReporterInterface>.

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...
20
        $runner->addAdditionalReporter('bar', $this->createMockReporter());
0 ignored issues
show
Documentation introduced by
$this->createMockReporter() is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Laminas\Diagnosti...rter\ReporterInterface>.

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
        $this->assertCount(0, $runner->getReporters());
0 ignored issues
show
Documentation introduced by
$runner->getReporters() is of type array|object<Traversable>, but the function expects a object<Countable>|object...nit\Framework\iterable>.

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...
23
24
        $runner->useAdditionalReporters(['baz']);
25
26
        $this->assertCount(0, $runner->getReporters());
0 ignored issues
show
Documentation introduced by
$runner->getReporters() is of type array|object<Traversable>, but the function expects a object<Countable>|object...nit\Framework\iterable>.

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...
27
28
        $runner->useAdditionalReporters(['foo']);
29
30
        $this->assertCount(1, $runner->getReporters());
0 ignored issues
show
Documentation introduced by
$runner->getReporters() is of type array|object<Traversable>, but the function expects a object<Countable>|object...nit\Framework\iterable>.

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...
31
32
        $runner->useAdditionalReporters(['bar']);
33
34
        $this->assertCount(2, $runner->getReporters());
0 ignored issues
show
Documentation introduced by
$runner->getReporters() is of type array|object<Traversable>, but the function expects a object<Countable>|object...nit\Framework\iterable>.

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...
35
36
        $runner = new Runner();
37
        $runner->addAdditionalReporter('foo', $this->createMockReporter());
0 ignored issues
show
Documentation introduced by
$this->createMockReporter() is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Laminas\Diagnosti...rter\ReporterInterface>.

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...
38
        $runner->addAdditionalReporter('bar', $this->createMockReporter());
0 ignored issues
show
Documentation introduced by
$this->createMockReporter() is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Laminas\Diagnosti...rter\ReporterInterface>.

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...
39
        $runner->useAdditionalReporters(['bar', 'foo']);
40
41
        $this->assertCount(2, $runner->getReporters());
0 ignored issues
show
Documentation introduced by
$runner->getReporters() is of type array|object<Traversable>, but the function expects a object<Countable>|object...nit\Framework\iterable>.

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...
42
    }
43
44
    /**
45
     * @return ReporterInterface
46
     */
47
    private function createMockReporter()
48
    {
49
        return $this->getMockBuilder(ReporterInterface::class)->getMock();
50
    }
51
}
52