Remove property, update error message

This commit is contained in:
2024-08-08 16:01:48 +01:00
parent e6daf6d6b2
commit bb6fe43cfe

View File

@@ -14,8 +14,6 @@ final class Badge
{
public string $finalClasses;
private ?string $colour;
public function __construct(private string $baseClasses)
{
}
@@ -41,7 +39,7 @@ final class Badge
} else {
if (null === $object) {
throw new \RuntimeException("You must specify a badge colour If no instance of BadgeableInterface is provided.");
throw new \RuntimeException(sprintf("You must specify a colour for the badge if no instance of %s is provided.", BadgeableInterface::class));
}
$palette = $object->getBadgeColour()->getPalette();