Skip to content

Commit

Permalink
Improve class name handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-lenz committed Nov 29, 2023
1 parent 2b43a4b commit 1c22cff
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/models/Attributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ public function getClasses(): array {
$classNames = explode(' ', $classNames);
}

return array_unique(
array_filter(
array_map('trim', $classNames)
)
);
return self::splitClassNames($classNames);
}

/**
Expand Down Expand Up @@ -240,8 +236,8 @@ static private function splitClassNames(array|string|null $classNames): array {
return [];
}

return array_values(array_filter(array_map('trim',
return array_values(array_unique(array_filter(array_map('trim',
is_string($classNames) ? explode(' ', $classNames) : $classNames
)));
))));
}
}

0 comments on commit 1c22cff

Please sign in to comment.