function FileFormField::initialize
Initializes the form field.
Throws
\LogicException When node type is incorrect
Overrides FormField::initialize
File
-
vendor/
symfony/ dom-crawler/ Field/ FileFormField.php, line 91
Class
- FileFormField
- FileFormField represents a file form field (an HTML file input tag).
Namespace
Symfony\Component\DomCrawler\FieldCode
protected function initialize() : void {
if ('input' !== $this->node->nodeName) {
throw new \LogicException(\sprintf('A FileFormField can only be created from an input tag (%s given).', $this->node->nodeName));
}
if ('file' !== strtolower($this->node
->getAttribute('type'))) {
throw new \LogicException(\sprintf('A FileFormField can only be created from an input tag with a type of file (given type is "%s").', $this->node
->getAttribute('type')));
}
$this->setValue(null);
}