-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat(support): add enums support #878
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I allowed myself to review before it's ready because I like the idea of this PR.
I love some enum helper methods, but I think they are too many. Specifically, I don't think InvokableCases
is useful, and I don't feel like Comparable::is
and isNot
are.
I like the idea, and many of the methods, but I think it should be one trait: |
My intend is to create a set of enums support that's firstly useful internally, but for end users, so I think we must provide some useful methods or DX even if we don't use them internally.
I agree, but to support as many people as possible, I have split things in multiple traits if people don't want to import everything. |
I think it's an edge case we don't need to support :) It's better to be in line with |
I'm ok to be straightforward with this, so should we stay with the name |
Good question. Our current naming strategy for traits involves prefixing with
IDK |
Same here, so I'll start by replacing |
Cool! I'm still undecided on whether it makes sense to have four traits which are combined into one. I'd like the simplicity of having everything in one trait, unless there's a very good reason not to. |
Also: tests now seem to be fine after merging main :) |
I asked Claude because I'm not good at naming, and here's what he suggests:
I do prefer the word "util" over "helper", but maybe for consistency we should go with what's already used in Tempest, so "helper". |
To be sure of what to do and what to decide @brendt @innocenzi
|
Let's let @brendt decide. imo both are fine but I understand the will to have just one trait.
It does but the name is too generic, it should be more specific
Let's go with "helper" for consistency, if we rename that later we'll do it in bulk
I personally definitely think so! |
Let's have one trait for now 👍
Yes, let's remove |
58ddc4f
to
28ad166
Compare
Ping me when ready btw :) |
@brendt then it's ready for me👌 |
LGTM 👍 |
Thanks for all the effort you put into this @gturpin-dev ! Let's merge :) Would you be able to also send a PR to the docs about it? It could go on https://tempestphp.com/docs/framework/primitive-helpers/ |
@brendt Sure, I'll check to make input there 🎉 Thanks for pointing out the locations 👌 |
I've added a docs entry for this :) |
Co-authored-by: Brent Roose <[email protected]>
This PR follows the discussion on Discord https://discord.com/channels/1236153076688359495/1323681600768315472
It add
enums
support using various traits to enable useful features for dealing withenums