The method collect() does not exist on Yiisoft\Yii\Debug\Collector\CollectorInterface. It seems like you code against a sub-type of said class. However, the method does not exist in Yiisoft\Yii\Debug\Collector\QueueCollector. Are you sure you never get one of those?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
20
$collector->/** @scrutinizer ignore-call */
21
collect(1, (new Result())->addError('Too low', ['arg1' => 'v1']), [new Number(min: 7)]);
Loading history...
21
$collector->collect(10, new Result(), [new Number(min: 7)]);
22
}
23
24
protected function getCollector(): CollectorInterface
25
{
26
return new ValidatorCollector();
27
}
28
29
protected function checkCollectedData(array $data): void
30
{
31
parent::checkCollectedData($data);
32
33
$this->assertEquals(
34
[
35
[
36
'value' => 1,
37
'rules' => [
38
new Number(min: 7),
39
],
40
'result' => false,
41
'errors' => [
42
new Error('Too low', ['arg1' => 'v1']),
43
],
44
],
45
[
46
'value' => 10,
47
'rules' => [
48
new Number(min: 7),
49
],
50
'result' => true,
51
'errors' => [],
52
],
53
],
54
$data
55
);
56
}
57
58
protected function checkIndexData(array $data): void