1
0
Fork 0
mirror of https://github.com/archtechx/enums.git synced 2025-12-12 08:04:04 +00:00
enums/src
Samuel Levy cc5bba1912
Issue #4: Added From trait (#7)
* #4 Added `From` trait

This adds the `from()` and `tryFrom()` methods to pure enums, and the `fromName()` and `tryFromName()` methods for all enum types.

* Code review changes

Dropped support for fragile indexes on pure enums

* Dropped unnecessary array_pop()

* import ValueError

* remove import

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-03-23 22:18:58 +01:00
..
Exceptions initial 2022-02-20 20:58:57 +01:00
From.php Issue #4: Added From trait (#7) 2022-03-23 22:18:58 +01:00
InvokableCases.php Extend functionality to work with pure enums (#6) 2022-03-23 21:42:35 +01:00
Names.php use array_column() to get the names, values, and options (#3) 2022-02-21 13:32:07 +01:00
Options.php Extend functionality to work with pure enums (#6) 2022-03-23 21:42:35 +01:00
Values.php Extend functionality to work with pure enums (#6) 2022-03-23 21:42:35 +01:00