These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
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
|
|||
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
$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 |
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: