Skip to content

fix: cache plain arrays instead of Result objects to prevent deserialization errors#17

Merged
pataar merged 3 commits intomainfrom
fix/cache-serialization-issue
Apr 1, 2026
Merged

fix: cache plain arrays instead of Result objects to prevent deserialization errors#17
pataar merged 3 commits intomainfrom
fix/cache-serialization-issue

Conversation

@pataar
Copy link
Copy Markdown
Owner

@pataar pataar commented Apr 1, 2026

Summary

  • Cache the result's plain array representation instead of the Result object itself, preventing __PHP_Incomplete_Class errors when Laravel deserializes cached entries
  • Add regression test covering the exact scenario from the bug report

Closes #16

Test plan

  • Existing tests pass (php vendor/bin/phpunit — 80 tests, 201 assertions)
  • PHPStan passes at level max
  • New test test_cache_returns_result_interface_not_incomplete_class verifies cached results deserialize correctly

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 1, 2026

Coverage Status

coverage: 100.0%. remained the same
when pulling 87155b5 on fix/cache-serialization-issue
into d9220f9 on main.

@pataar pataar force-pushed the fix/cache-serialization-issue branch from 2658e95 to 009fb22 Compare April 1, 2026 17:27
@pataar pataar enabled auto-merge (squash) April 1, 2026 17:29
@pataar pataar merged commit 1068b06 into main Apr 1, 2026
12 checks passed
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.

TypeError

2 participants