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
This commit is contained in:
commit
9836dffbd2
|
@ -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.');
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue