7474 * @author Laurent LEGAZ <laurent@legaz.eu>
7575 * @version 1.0
7676 * @see RedisCache Parent class providing base Redis functionality
77- * @see https://redis.io/docs/data-types/hashes/ Redis Hash documentation
77+ * @see https://redis.io/docs/latest/develop/ data-types/# hashes Redis Hash documentation
7878 */
7979class RedisEnhancedCache extends RedisCache
8080{
@@ -96,16 +96,9 @@ class RedisEnhancedCache extends RedisCache
9696 * Stores multiple key-value pairs in a specified Redis Hash pool.
9797 *
9898 * This method allows batch insertion of cache entries into a named pool using Redis Hash operations.
99- * All values are automatically serialized before storage to ensure consistency. The method uses
100- * HMSET for multiple values and HSET for single values to optimize Redis operations.
101- *
102- * <b>Behavior:</b>
103- * - For multiple values (count > 1): Uses Redis HMSET command
104- * - For single value (count === 1): Uses Redis HSET command
105- * - For empty array: Returns false without Redis operation
99+ * All values are automatically serialized before storage to ensure consistency.
106100 *
107101 * <b>Data Processing:</b>
108- * - Keys are validated against PSR compliance rules (except for the ":" character which is accepted)
109102 * - Values are serialized using internal serialization mechanism
110103 * - Both keys and values undergo validation before storage
111104 *
@@ -193,15 +186,8 @@ public function storeToPool(array $values, string $pool = self::DEFAULT_POOL): b
193186 *
194187 * All retrieved values are automatically unserialized to restore their original data types.
195188 *
196- * <b>Return Behavior:</b>
197- * - Single key (string/int): Returns the value or DOES_NOT_EXIST constant
198- * - Multiple keys (array): Returns associative array of key => value pairs
199- * - Non-existent keys: Replaced with DOES_NOT_EXIST constant in results
200- * - Invalid parameters: Throws InvalidKeyException
201- *
202189 * <b>Data Processing:</b>
203190 * - Values are automatically deserialized upon retrieval
204- * - String values are converted back to their original types
205191 * - Missing values are marked with DOES_NOT_EXIST constant
206192 * - Array results maintain key association from input
207193 *
@@ -273,12 +259,6 @@ public function fetchFromPool(mixed $key, string $pool = self::DEFAULT_POOL): mi
273259 * which is useful for conditional logic and validation operations. It uses Redis HEXISTS
274260 * command for optimal performance.
275261 *
276- * <b>Implementation Notes:</b>
277- * - Uses native Redis HEXISTS command for efficiency
278- * - Handles adapter differences between php-redis and predis clients
279- * - php-redis returns boolean true/false
280- * - predis returns integer 1/0
281- * - Both are normalized to boolean return value
282262 *
283263 * <b>Usage Examples:</b>
284264 * <code>
@@ -339,7 +319,6 @@ public function hasInPool(string $key, string $pool = self::DEFAULT_POOL): bool
339319 *
340320 * <b>Behavior:</b>
341321 * - Uses Redis HDEL for atomic deletion
342- * - All keys are validated before deletion attempt
343322 * - Non-existent keys are silently ignored (not treated as errors)
344323 * - Returns true if Redis operation succeeds (even if some keys didn't exist)
345324 *
@@ -455,6 +434,10 @@ public function setHsetPoolExpiration(string $pool = self::DEFAULT_POOL, int $ex
455434 $ redisResponse = -1 ;
456435
457436 if ($ expirationTime > 0 ) {
437+ /**
438+ * <b>CRITICAL WARNING:</b>
439+ * Expiration applies to the ENTIRE pool !
440+ */
458441 $ redisResponse = $ this ->getRedis ()->expire ($ pool , $ expirationTime );
459442 }
460443
0 commit comments