original_string: public static function set($key, $data, $ttl = self::TTL_NO_EXPIRY, $tags = [])
      {
          if (!$cache = self::getInstance()) {
              return false;
          }
  
          $key = self::prepare($key);
          try {
              $item = $cache->getItem($key);
              $item->set($data);
  
              if (self::TTL_NO_EXPIRY !== $ttl) {
                  $item->expiresAfter($ttl);
              }
  
              if (!empty($tags)) {
                  $item->setTags($tags);
              }
  
              return $cache->save($item);
          } catch (InvalidArgumentException $e) {
              // something going wrong
              Logger::error($e->getMessage());
          }
  
          return false;
      }
code: public static function set($key, $data, $ttl = self::TTL_NO_EXPIRY, $tags = [])
      {
          if (!$cache = self::getInstance()) {
              return false;
          }
  
          $key = self::prepare($key);
          try {
              $item = $cache->getItem($key);
              $item->set($data);
  
              if (self::TTL_NO_EXPIRY !== $ttl) {
                  $item->expiresAfter($ttl);
              }
  
              if (!empty($tags)) {
                  $item->setTags($tags);
              }
  
              return $cache->save($item);
          } catch (InvalidArgumentException $e) {
              // something going wrong
              Logger::error($e->getMessage());
          }
  
          return false;
      }
code_tokens: public static function set ( $ key , $ data , $ ttl = self :: TTL_NO_EXPIRY , $ tags = [ ] ) { if ( ! $ cache = self :: getInstance ( ) ) { return false ; } $ key = self :: prepare ( $ key ) ; try { $ item = $ cache -> getItem ( $ key ) ; $ item -> set ( $ data ) ; if ( self :: TTL_NO_EXPIRY !== $ ttl ) { $ item -> expiresAfter ( $ ttl ) ; } if ( ! empty ( $ tags ) ) { $ item -> setTags ( $ tags ) ; } return $ cache -> save ( $ item ) ; } catch ( InvalidArgumentException $ e ) { // something going wrong Logger :: error ( $ e -> getMessage ( ) ) ; } return false ; }
docstring: Set value of cache item
  
  @param  string   $key
  @param  mixed    $data
  @param  int      $ttl
  @param  string[] $tags
  
  @return bool
docstring_tokens: Set value of cache item