8000 [DomCrawler] Avoid a useless call to strtolower · symfony/symfony@c77d142 · GitHub
[go: up one dir, main page]

Skip to content

Commit c77d142

Browse files
committed
[DomCrawler] Avoid a useless call to strtolower
1 parent ffd088a commit c77d142

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/DomCrawler/Field/InputFormField.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ protected function initialize()
3232
throw new \LogicException(sprintf('An InputFormField can only be created from an input or button tag (%s given).', $this->node->nodeName));
3333
}
3434

35-
if ('checkbox' === strtolower($this->node->getAttribute('type'))) {
35+
$type = strtolower($this->node->getAttribute('type'));
36+
if ('checkbox' === $type) {
3637
throw new \LogicException('Checkboxes should be instances of ChoiceFormField.');
3738
}
3839

39-
if ('file' === strtolower($this->node->getAttribute('type'))) {
40+
if ('file' === $type) {
4041
throw new \LogicException('File inputs should be instances of FileFormField.');
4142
}
4243

0 commit comments

Comments
 (0)
0