Skip to content

Commit cf52dda

Browse files
committed
[ci skip] Add method to UG
1 parent 490abe8 commit cf52dda

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

user_guide_src/source/libraries/caching.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,21 @@ Class Reference
229229
on which adapter is being used. Some adapters (File, Memcached, Wincache)
230230
still return ``false`` for missing items.
231231

232+
.. php:staticmethod:: validateKey(string $key, string $prefix)
233+
234+
:param string $key: Potential cache key
235+
:param string $prefix: Optional prefix
236+
:returns: The verified and prefixed key. If the key exceeds the driver's max key length it will be hashed.
237+
:rtype: string
238+
239+
This method is used by handler methods to check that keys are valid. It will throw
240+
an ``InvalidArgumentException`` for non-strings, invalid characters, and empty lengths.
241+
242+
Example::
243+
244+
$prefixedKey = BaseHandler::validateKey($key, $prefix);
245+
246+
232247
*******
233248
Drivers
234249
*******

0 commit comments

Comments
 (0)