The method upload() does not exist on Symfony\Component\DomCrawler\Field\FormField. It seems like you code against a sub-type of Symfony\Component\DomCrawler\Field\FormField such as Symfony\Component\DomCrawler\Field\FileFormField.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
35
$this->inner->/** @scrutinizer ignore-call */
36
upload($file);
Loading history...
36
}
37
38
return;
39
}
40
41
// Hack to allow multiple files to be attached
42
$this->inner->upload(\array_shift($files));
43
44
if (empty($files)) {
45
// not multiple files
46
return;
47
}
48
49
if (!$this->attr('multiple')) {
50
throw new \InvalidArgumentException('Cannot attach multiple files to a non-multiple file field.');
51
}
52
53
foreach ($files as $file) {
54
$field = new FileFormField($this->dom->getNode(0));
It seems like $this->dom->getNode(0) can also be of type Zenstruck\Browser\Dom and null; however, parameter $node of Symfony\Component\DomCra...ormField::__construct() does only seem to accept DOMElement, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
54
$field = new FileFormField(/** @scrutinizer ignore-type */ $this->dom->getNode(0));