[DomCrawler] Avoid a useless call to strtolower
This commit is contained in:
parent
ffd088a38f
commit
c77d1428e8
@ -32,11 +32,12 @@ class InputFormField extends FormField
|
|||||||
throw new \LogicException(sprintf('An InputFormField can only be created from an input or button tag (%s given).', $this->node->nodeName));
|
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.');
|
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.');
|
throw new \LogicException('File inputs should be instances of FileFormField.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user