laminas / laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output
https://docs.laminas.dev/laminas-cache/
BSD 3-Clause "New" or "Revised" License
103 stars 52 forks source link

Allow integerish keys in methods handling multiple keys at once #315

Closed boesing closed 5 months ago

boesing commented 5 months ago
Q A
Bugfix no
BC Break no
New Feature no

Description

In the (non-official) PSR integration tests are checks for iterables with a non-empty-string cache key 0. Internal PHP type juggling converts integerish strings to int which leads to a type conflict when passing these values to our internal assertion. Therefore, this patch provides compatibility for integer keys in methods consuming iterable keys either in key-value or key-only combination.

Ref: https://github.com/php-cache/integration-tests/blob/824633c9547dc3c7ac5faeca03dd82939cdeb73c/src/SimpleCacheTest.php#L258-L267