From 1c22cff35add12487ad2039e857c7987c2964923 Mon Sep 17 00:00:00 2001 From: Sebastian Lenz Date: Wed, 29 Nov 2023 19:23:18 +0100 Subject: [PATCH] Improve class name handling --- src/models/Attributes.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/models/Attributes.php b/src/models/Attributes.php index d331ddf..3e91b30 100644 --- a/src/models/Attributes.php +++ b/src/models/Attributes.php @@ -119,11 +119,7 @@ public function getClasses(): array { $classNames = explode(' ', $classNames); } - return array_unique( - array_filter( - array_map('trim', $classNames) - ) - ); + return self::splitClassNames($classNames); } /** @@ -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 - ))); + )))); } }