mirror of
https://codeberg.org/vlw/php-xenum.git
synced 2025-09-13 20:23:41 +02:00
fix(doc): wrong example
This commit is contained in:
parent
6644be84ae
commit
243abfc531
1 changed files with 2 additions and 2 deletions
|
@ -16,9 +16,9 @@ enum HelloWorld: string {
|
||||||
case BAZ = "QUX";
|
case BAZ = "QUX";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Like Enum::tryFrom() but for Enum names instead of values
|
// Like Enum::from() but for Enum names instead of values
|
||||||
HelloWorld::fromName("FOO"); // HelloWorld::FOO
|
HelloWorld::fromName("FOO"); // HelloWorld::FOO
|
||||||
// .. and of course the non-throwing version
|
// And of course the non-throwing version similar to Enum::tryFrom()
|
||||||
HelloWorld::tryFromName("MOM"); // null
|
HelloWorld::tryFromName("MOM"); // null
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue