Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #4: Added From trait #7

Merged
merged 6 commits into from
Mar 23, 2022

Conversation

samlev
Copy link
Contributor

@samlev samlev commented Mar 13, 2022

Looking at @stancl's suggestion in Issue #4, I've added the From trait.

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

This adds the `from()` and `tryFrom()` methods to pure enums, and the `fromName()` and `tryFromName()` methods for all enum types.
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/From.php Outdated Show resolved Hide resolved
src/From.php Outdated Show resolved Hide resolved
src/From.php Outdated Show resolved Hide resolved
@samlev samlev force-pushed the issues/#4_fromName_tryFromName branch from 1ff3cc8 to ce6c664 Compare March 14, 2022 21:26
Dropped support for fragile indexes on pure enums
@samlev samlev force-pushed the issues/#4_fromName_tryFromName branch from ce6c664 to ad1e07c Compare March 14, 2022 21:33
@stancl
Copy link
Member

stancl commented Mar 15, 2022

@samlev Can you mark the implemented reviews as "resolved"? So that I can see if there's anything missing

@stancl
Copy link
Member

stancl commented Mar 15, 2022

Also in #6

@samlev
Copy link
Contributor Author

samlev commented Mar 15, 2022

@stancl done

src/From.php Show resolved Hide resolved
@stancl stancl linked an issue Mar 23, 2022 that may be closed by this pull request
@stancl stancl merged commit cc5bba1 into archtechx:master Mar 23, 2022
@stancl
Copy link
Member

stancl commented Mar 23, 2022

Thanks a lot!

@samlev samlev deleted the issues/#4_fromName_tryFromName branch March 23, 2022 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fromName() & tryFromName()
2 participants