original_string: public function set(string $key, $value, int $ttl = null): void
      {
          $keyMD5 = md5($key);
          $key = $this->keyPrefix . substr($keyMD5, 0, 3) . '/' . substr($keyMD5, 3) . '.2';
          $this->dataRepository->setValue($key, gzcompress(serialize([$ttl > 0 ? time() + $ttl : 0, $value])));
      }
code: public function set(string $key, $value, int $ttl = null): void
      {
          $keyMD5 = md5($key);
          $key = $this->keyPrefix . substr($keyMD5, 0, 3) . '/' . substr($keyMD5, 3) . '.2';
          $this->dataRepository->setValue($key, gzcompress(serialize([$ttl > 0 ? time() + $ttl : 0, $value])));
      }
code_tokens: public function set ( string $ key , $ value , int $ ttl = null ) : void { $ keyMD5 = md5 ( $ key ) ; $ key = $ this -> keyPrefix . substr ( $ keyMD5 , 0 , 3 ) . '/' . substr ( $ keyMD5 , 3 ) . '.2' ; $ this -> dataRepository -> setValue ( $ key , gzcompress ( serialize ( [ $ ttl > 0 ? time ( ) + $ ttl : 0 , $ value ] ) ) ) ; }
docstring: Stores a value in the cache.
  
  @param string $key The key under which to store the value.
  @param type $value The value to store.
  @param int $ttl Number of seconds to store value in the cache.
  @return void No value is returned.
docstring_tokens: Stores a value in the cache .