@@ -49,9 +49,9 @@ public function get($key, $default = null)
4949 /**
5050 * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
5151 *
52- * @param string $key The key of the item to store.
53- * @param mixed $value The value of the item to store. Must be serializable.
54- * @param null|integer|\ DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
52+ * @param string $key The key of the item to store.
53+ * @param mixed $value The value of the item to store. Must be serializable.
54+ * @param null|integer|DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
5555 * the driver supports TTL then the library may set a default value
5656 * for it or let the driver take care of that.
5757 *
@@ -154,8 +154,8 @@ public function getMultiple($keys, $default = null)
154154 /**
155155 * Persists a set of key => value pairs in the cache, with an optional TTL.
156156 *
157- * @param iterable $values A list of key => value pairs for a multiple-set operation.
158- * @param null|integer|\ DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
157+ * @param iterable $values A list of key => value pairs for a multiple-set operation.
158+ * @param null|integer|DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
159159 * the driver supports TTL then the library may set a default value
160160 * for it or let the driver take care of that.
161161 *
@@ -239,12 +239,7 @@ public function has($key)
239239
240240 $ meta = $ this ->adapter ->getMetaData ($ key );
241241
242- // If the adapter does not return an array or if the item is expired then it is a miss
243- if (! is_array ($ meta ) || (is_int ($ meta ['expire ' ]) && $ meta ['expire ' ] < time ()))
244- {
245- return false ;
246- }
247-
248- return true ;
242+ // The adapter must return an array that is not expired
243+ return is_array ($ meta ) && is_int ($ meta ['expire ' ]) && $ meta ['expire ' ] > time ();
249244 }
250245}
0 commit comments