throw new \LogicException(sprintf('An InputFormField can only be created from an input or button tag (%s given).', $this->node->nodeName));
}
- if ('checkbox' === strtolower($this->node->getAttribute('type'))) {
+ $type = strtolower($this->node->getAttribute('type'));
+ if ('checkbox' === $type) {
throw new \LogicException('Checkboxes should be instances of ChoiceFormField.');
}
- if ('file' === strtolower($this->node->getAttribute('type'))) {
+ if ('file' === $type) {
throw new \LogicException('File inputs should be instances of FileFormField.');
}