Skip to content

Commit 32a0bb2

Browse files
Change constructor
1 parent 581a282 commit 32a0bb2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Field/Style/BadgeStyle.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
final class BadgeStyle
66
{
7-
private function __construct(private string $classes, private string $style)
7+
/**
8+
* @param array<string> $classes
9+
* @param array<string, string> $style
10+
*/
11+
private function __construct(private readonly array $classes, private readonly array $style)
812
{
913
}
1014

@@ -25,17 +29,17 @@ public static function fromBgColor(string $backgroundColor, ?string $textColor =
2529
throw new \InvalidArgumentException(sprintf('The text color must be a full 6-digit hexadecimal color ("%s" given).', $textColor));
2630
}
2731

28-
return new self(implode(' ', $classes), self::generateStyle($styleProperties));
32+
return new self($classes, $styleProperties);
2933
}
3034

3135
public function getClasses(): string
3236
{
33-
return $this->classes;
37+
return implode(' ', $this->classes);
3438
}
3539

3640
public function getStyle(): string
3741
{
38-
return $this->style;
42+
return self::generateStyle($this->style);
3943
}
4044

4145
/**

0 commit comments

Comments
 (0)