Completed
Push — master ( d7f3a5...d6e5bd )
by
unknown
95:27 queued 72:17
created

Unit   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDBALQueryBuilder() 0 14 1
A getORMQueryBuilder() 0 6 1
1
<?php
2
namespace Kunstmaan\AdminListBundle\Tests\Helper;
3
4
use Codeception\Stub;
5
use Doctrine\DBAL\Connection;
6
use Doctrine\DBAL\Query\Expression\ExpressionBuilder;
7
use Doctrine\ORM\EntityManager;
8
9
class Unit extends \Codeception\Module
10
{
11
    public function getDBALQueryBuilder()
12
    {
13
        /* @var Stub $conn */
14
        $conn = Stub::make(Connection::class, [
15
        ]);
16
17
        $expressionBuilder = new ExpressionBuilder($conn);
0 ignored issues
show
Documentation introduced by
$conn is of type object<Codeception\Stub>, but the function expects a object<Doctrine\DBAL\Connection>.

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
        /* @var Stub $conn */
19
        $conn = Stub::make(Connection::class, [
20
            'getExpressionBuilder' => $expressionBuilder
21
        ]);
22
23
        return new \Doctrine\DBAL\Query\QueryBuilder($conn);
0 ignored issues
show
Documentation introduced by
$conn is of type object<Codeception\Stub>, but the function expects a object<Doctrine\DBAL\Connection>.

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...
24
    }
25
26
    public function getORMQueryBuilder()
27
    {
28
        $em = Stub::make(EntityManager::class, []);
29
30
        return new \Doctrine\ORM\QueryBuilder($em);
31
    }
32
}
33