Skip to content

Commit 38a7a9c

Browse files
committed
Improvement to make removeClass() pass.
1 parent 77975a9 commit 38a7a9c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/AdamWathan/Form/Elements/Element.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ public function removeClass($class)
5555
if (! isset($this->attributes['class'])) {
5656
return $this;
5757
}
58+
5859
$class = trim(str_replace($class, '', $this->attributes['class']));
60+
if ($class == '') {
61+
$this->removeAttribute('class');
62+
return $this;
63+
}
64+
5965
$this->setAttribute('class', $class);
6066
return $this;
6167
}

0 commit comments

Comments
 (0)