The call to Yiisoft\Db\Querys\Query::count() has too many arguments starting with $db.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
28
$this->assertEquals(1, (new Query($db))->from('bool_values')->where('bool_col = TRUE')->/** @scrutinizer ignore-call */ count('*', $db));
This check compares calls to functions or methods with their respective definitions.
If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.
Loading history...
29
$this->assertEquals(1, (new Query($db))->from('bool_values')->where('bool_col = FALSE')->count('*', $db));
30
$this->assertEquals(
31
2,
32
(new Query($db))->from('bool_values')->where('bool_col IN (TRUE, FALSE)')->count('*', $db)
33
);
34
$this->assertEquals(1, (new Query($db))->from('bool_values')->where(['bool_col' => true])->count('*', $db));
35
$this->assertEquals(1, (new Query($db))->from('bool_values')->where(['bool_col' => false])->count('*', $db));
36
$this->assertEquals(
37
2,
38
(new Query($db))->from('bool_values')->where(['bool_col' => [true, false]])->count('*', $db)
39
);
40
$this->assertEquals(
41
1,
42
(new Query($db))->from('bool_values')->where('bool_col = :bool_col', ['bool_col' => true])->count('*', $db)
43
);
44
$this->assertEquals(
45
1,
46
(new Query($db))->from('bool_values')->where('bool_col = :bool_col', ['bool_col' => false])->count('*', $db)
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.