Skip to content

Commit

Permalink
Fix missing classes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiandedeyne committed Mar 13, 2023
1 parent a630d58 commit 4ca16b2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Html/Attributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,10 @@ public function isEmpty(): bool

public function toArray(): array
{
if (empty($this->classes) || empty($this->id)) {
return $this->attributes;
}

return array_merge($this->attributes, [
return array_merge($this->attributes, array_filter([
'class' => implode(' ', $this->classes),
'id' => implode(' ', $this->id),
]);
'id' => $this->id,
]));
}

public function toString(): string
Expand Down

0 comments on commit 4ca16b2

Please sign in to comment.