Commit 09604db
committed
feat: implement universal cache type detection for PSR-16 implementations
- Add universal Redis/Memcached connection detection via reflection
- Support direct cache instance checking (Redis, Memcached, Predis)
- Add recursive property search methods (findRedisInProperties, findMemcachedInProperties)
- Enhance detectCacheType() with multi-level strategy:
* Level 1: Check already discovered connections (fastest)
* Level 2: Direct type checking (instanceof)
* Level 3: Universal reflection for any PSR-16 implementation
* Level 4: Class name pattern matching (fallback)
- Update getRedisConnection() and getMemcachedConnection() for universal support
- Works with Symfony Cache, direct wrappers, and any custom PSR-16 implementations
- Add phpstan.neon ignore pattern for ReflectionClass generic type warnings
This allows cache type detection to work universally with any PSR-16 cache
implementation, not just Symfony Cache, by recursively searching for Redis/Memcached
connections in object properties.1 parent 77cd891 commit 09604db
2 files changed
+289
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments