BenMakesGames / BenMakesGames/PoppySeedPets
convert fake enums to real enums
- Dominant language
- PHP
- Stars
- 15
- Forks
- 6
- Avg merge
- 5m
- Merged PRs (30d)
- 2
Description
**context:** Poppy Seed Pets was started before PHP had real enums, so it does what a lot of PHP apps at the time did, which is kinda'-sorta' fake enums using consts and traits and things.
**todo:** convert PSP's fake enums to real, actual enums.
be mindful of serialization, including:
* endpoints that accept an enum-ish value from the user; their input should be validated (search for `UserLinkWebsiteEnum::tryFrom($websiteName)` for an example)
* database entities (see the `UserLink` entity class for an example)
* response DTOs - whatever was returned to the front-end before converting a fake enum to a real one should still be returned _after_ the conversion (this may work for free, but, you know: gotta' check!)
Contributor guide
No contributing guide indexed for this repository
Research direction
Inventory the fake enums, then read UserLinkWebsiteEnum::tryFrom($websiteName) and the UserLink entity as the stated examples. Check endpoints accepting enum-like input, database entities, and response DTOs; done means all fake enums use real PHP enums, inputs are validated, and serialized responses remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- api, backend, database
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100