From 7ac6d3877e80df39286f6d1ee9b349d9408e521e Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Fri, 22 Nov 2024 17:26:51 +0100 Subject: [PATCH] Update readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 013a777..6369f32 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,12 @@ enum BackedEnum: int The above enum defines 3 meta for each case: `color`, `shape` and `isOdd`. The `#[Meta]` attributes are ideal to declare static information, whilst public non-static methods are ideal to declare dynamic information. +To access a case meta, we can simply call the method having the same name of the wanted meta: + +```php +BackedEnum::Two->color(); // green +``` + `#[Meta]` attributes can also be attached to the enum itself to provide default values when a case does not declare its own meta values: ```php