[DomCrawler] Avoid a useless call to strtolower

This commit is contained in:
Kévin Dunglas 2018-03-15 17:07:34 +01:00
parent ffd088a38f
commit c77d1428e8
No known key found for this signature in database
GPG Key ID: 4D04EBEF06AAF3A6
1 changed files with 3 additions and 2 deletions

View File

@ -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));
}
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.');
}