givewp icon indicating copy to clipboard operation
givewp copied to clipboard

Chore: update base enum class with forked version from myclabs

Open jonwaldstein opened this issue 9 months ago • 1 comments

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

jonwaldstein avatar May 03 '24 14:05 jonwaldstein

This PR is stale because it has been open 45 days with no activity. Stale PRs will NOT be automatically closed.

github-actions[bot] avatar Jun 28 '24 01:06 github-actions[bot]