Skip to content

Commit 5b94fc6

Browse files
committed
coding style
1 parent 849b672 commit 5b94fc6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Forms/Controls/TextInput.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public function addRule($validator, $errorMessage = null, $arg = null)
8181
static $types = [Form::EMAIL => 'email', Form::URL => 'url', Form::INTEGER => 'number'];
8282
$this->control->type = $types[$validator];
8383

84-
} elseif (in_array($validator, [Form::MIN, Form::MAX, Form::RANGE], true)
84+
} elseif (
85+
in_array($validator, [Form::MIN, Form::MAX, Form::RANGE], true)
8586
&& in_array($this->control->type, ['number', 'range', 'datetime-local', 'datetime', 'date', 'month', 'week', 'time'], true)
8687
) {
8788
if ($validator === Form::MIN) {
@@ -98,7 +99,9 @@ public function addRule($validator, $errorMessage = null, $arg = null)
9899
$this->control->max = isset($this->control->max) ? min($this->control->max, $range[1]) : $range[1];
99100
}
100101

101-
} elseif ($validator === Form::PATTERN && is_scalar($arg)
102+
} elseif (
103+
$validator === Form::PATTERN
104+
&& is_scalar($arg)
102105
&& in_array($this->control->type, [null, 'text', 'search', 'tel', 'url', 'email', 'password'], true)
103106
) {
104107
$this->control->pattern = $arg;

0 commit comments

Comments
 (0)