From f0c19dad5ecf8bdf1f734ec52b59dd3f8915625a Mon Sep 17 00:00:00 2001 From: brabli <67018167+brabli@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:41:21 +0000 Subject: [PATCH] Update readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fbf086f..01c3a38 100644 --- a/README.md +++ b/README.md @@ -20,21 +20,21 @@ Create badges from objects or as standalone elements. Any object that you would like to be able to be turned into a badge must implement `BadgeableInterface`. -This interface specifies a single method `getBadgeColour()` and is used to determine what colour the badge should be rendered as. +This interface specifies a single method `getBadgeColour()` which expects an instance of the enum `BadgeColour` to be returned and is used to determine the colour of the rendered badge. This method can contain as much logic in it as you'd like to return different colours of badge under different circumstances. EG: ```php // Job.php -public function getBadgeColour(): Badge +public function getBadgeColour(): BadgeColour { return match ($this->getKind()) { - JobKind::Investigation => Badge::BLUE, - JobKind::Interrogation => Badge::RED, - JobKind::Shootout => Badge::BLACK, - JobKind::SipWhiskey => Badge::FOREST, - default => Badge::GREY + JobKind::Investigation => BadgeColour::BLUE, + JobKind::Interrogation => BadgeColour::RED, + JobKind::Shootout => BadgeColour::BLACK, + JobKind::SipWhiskey => BadgeColour::FOREST, + default => BadgeColour::GREY }; } ```