Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
Improvement to make removeClass() pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseleite committed May 30, 2015
1 parent 77975a9 commit 38a7a9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/AdamWathan/Form/Elements/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ public function removeClass($class)
if (! isset($this->attributes['class'])) {
return $this;
}

$class = trim(str_replace($class, '', $this->attributes['class']));
if ($class == '') {
$this->removeAttribute('class');
return $this;
}

$this->setAttribute('class', $class);
return $this;
}
Expand Down

0 comments on commit 38a7a9c

Please sign in to comment.