src/CacheKeyTrait.php
protected function validateKey($key)
    {
        if (!is_string($key)) {
            throw new CacheKeyException("Cache key must be a string, " . gettype($key) . " given");
        }

        if (preg_match("/[^A-Za-z0-9\._-]/", $key)) {
            throw new CacheKeyException("Cache key contains invalid characters: {$key}");
        }

        if (strlen($key) > 64) {
            throw new CacheKeyException("Cache key cannot be longer than 64 characters: {$key}");
        }
    }
protected function validateKey($key)
    {
        if (!is_string($key)) {
            throw new CacheKeyException("Cache key must be a string, " . gettype($key) . " given");
        }

        if (preg_match("/[^A-Za-z0-9\._-]/", $key)) {
            throw new CacheKeyException("Cache key contains invalid characters: {$key}");
        }

        if (strlen($key) > 64) {
            throw new CacheKeyException("Cache key cannot be longer than 64 characters: {$key}");
        }
    }
protected function validateKey ( $ key ) { if ( ! is_string ( $ key ) ) { throw new CacheKeyException ( "Cache key must be a string, " . gettype ( $ key ) . " given" ) ; } if ( preg_match ( "/[^A-Za-z0-9\._-]/" , $ key ) ) { throw new CacheKeyException ( "Cache key contains invalid characters: {$key}" ) ; } if ( strlen ( $ key ) > 64 ) { throw new CacheKeyException ( "Cache key cannot be longer than 64 characters: {$key}" ) ; } }
Check the passed key to ensure it's a valid cache key.

@param string $key

@return void
@throws CacheKeyException
Check the passed key to ensure it s a valid cache key .