8000 minor #26544 [DomCrawler] Avoid a useless call to strtolower (dunglas) · symfony/symfony@9836dff · GitHub
[go: up one dir, main page]

Skip to content

Commit 9836dff

Browse files
minor #26544 [DomCrawler] Avoid a useless call to strtolower (dunglas)
This PR was merged into the 2.7 branch. Discussion ---------- [DomCrawler] Avoid a useless call to strtolower | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | yes<!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? |no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a minor Commits ------- c77d142 [DomCrawler] Avoid a useless call to strtolower
2 parents df6024d + c77d142 commit 9836dff

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