Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cerbero90 committed Nov 22, 2024
1 parent e34ade9 commit 7ac6d38
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ac6d38

Please sign in to comment.