From bb6fe43cfef14ac2eeb805eff7f8de8ed0e8e02c Mon Sep 17 00:00:00 2001 From: Bradley Date: Thu, 8 Aug 2024 16:01:48 +0100 Subject: [PATCH] Remove property, update error message --- src/Twig/Component/Badge.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Twig/Component/Badge.php b/src/Twig/Component/Badge.php index bc09ebd..35e8fd3 100644 --- a/src/Twig/Component/Badge.php +++ b/src/Twig/Component/Badge.php @@ -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();