Skip to content

chore(doc) #28 Invalid cache keys are only rejected by Symfony adapters when assertions are enabled - #29

Merged
njoubert-cleverage merged 1 commit into
mainfrom
28
Oct 1, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
28

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #28.

The documentation stated that an invalid cache key (empty, or with reserved characters) always throws a Psr\Cache\InvalidArgumentException. Symfony adapters only validate the keys with assert(): with zend.assertions=-1 (production php.ini), invalid keys are silently accepted.

  • reference/adapter.md: the keys are validated by the decorated pool, with assert() for Symfony adapters
  • reference/tasks/set_task.md, get_task.md: a placeholder key '' not overridden by the input is rejected only when assertions are enabled; in production, every item is stored / read under the same empty key

Checked with ArrayAdapter and FilesystemAdapter: InvalidArgumentException with zend.assertions=1, item stored and read back with zend.assertions=-1.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None (documentation only).

🤖 Generated with Claude Code

…rs when assertions are enabled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 036dfa0 into main Oct 1, 2026
17 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.

The documentation states that invalid cache keys always throw an exception

1 participant