givewp
givewp copied to clipboard
Chore: update base enum class with forked version from myclabs
Resolves: GIVE-760
Description
We have a php 8.1 incompatibility conflict with the myclabs/php-enum class. Unfortunately we are currently tied to php 7.2 at the moment and cannot update to their latest package that resolves the conflict.
Return type of MyCLabs\Enum\Enum::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/myclabs/php-enum/src/Enum.php on line 246
Furthermore, this package is not really maintained anymore since enums were introduced in php 8.1
So for more control over stability and compatibility with GiveWP, this PR forks the base enum class from myclabs including the unit tests and updates our Enum to extend it.
Affects
This technically affects our value objects that extend the enum class, however it's still the same logic with the namespace being our own so the risk is very low.
- Fee recovery add-on is currently using the myclabs library loaded from give core https://github.com/impress-org/give-fee-recovery/pull/336
Visuals
N/A
Testing Instructions
Unit tests and static analysis should take care of the bulk testing. We will want to run through QA regression testing as well.
Pre-review Checklist
- [ ] Acceptance criteria satisfied and marked in related issue
- [x] Relevant
@unreleased
tags included in DocBlocks - [x] Includes unit tests
- [ ] Reviewed by the designer (if follows a design)
- [ ] Self Review of code and UX completed
This PR is stale because it has been open 45 days with no activity. Stale PRs will NOT be automatically closed.