Skip to content

Commit ab28796

Browse files
Refactor code
1 parent 27e52ac commit ab28796

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/HtmlBuilder.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function attributes($attributes)
8787
$html = [];
8888

8989
foreach ((array)$attributes as $key => $value) {
90-
$element = $this->attributeElement($key, $value);
90+
$element = is_numeric($key) ? $key : $this->attributeElement($key, $value);
9191

9292
if (empty($element)) {
9393
continue;
@@ -109,10 +109,6 @@ public function attributes($attributes)
109109
*/
110110
protected function attributeElement($key, $value)
111111
{
112-
if (is_numeric($key)) {
113-
return $value;
114-
}
115-
116112
// Treat boolean attributes as HTML properties
117113
if (is_bool($value) && $key !== 'value') {
118114
return $value ? $key : '';

0 commit comments

Comments
 (0)