Skip to content

Add PSR-6 cache adapter - #85

Draft
vanderlee wants to merge 1 commit into
masterfrom
agent/psr6-cache-adapter
Draft

Add PSR-6 cache adapter#85
vanderlee wants to merge 1 commit into
masterfrom
agent/psr6-cache-adapter

Conversation

@vanderlee

Copy link
Copy Markdown
Owner

What changed

  • Add a Vanderlee\Syllable\Cache\Psr6 adapter for PSR-6 cache pools.
  • Preserve the existing Cache strategy and Syllable::setCache() API.
  • Support psr/cache versions 1, 2, and 3 so Symfony Cache and other PSR-6 implementations can be used.
  • Add adapter lifecycle and cache-miss tests.
  • Document Symfony Cache usage without making Symfony a runtime dependency.
  • Allow PHPUnit 9.6 on modern PHP so PSR-6 v3 interfaces can be mocked, while retaining the older PHPUnit ranges for PHP 7.1.

Why

Issue #24 proposed interchangeable internal components without breaking legacy integrations. Namespacing and the strategy interfaces are already present; this PR completes the concrete PSR-6 caching part as an additive adapter and leaves the optimized hyphenation algorithm untouched.

Compatibility

Existing file, JSON, serialized, and custom Cache implementations continue to work unchanged. Applications opt into PSR-6 explicitly by passing the adapter to the existing setter.

Validation

  • composer validate --no-check-publish --no-check-lock
  • PHPUnit functional suite: 48 tests, 121 assertions; 2 existing warnings and 2 existing incomplete tests
  • PHP syntax checks for the adapter and its tests

Closes #24.

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.

Reworking API internals

1 participant