vendor/shopware/core/Framework/Adapter/Cache/CacheCompressor.php line 32

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\Adapter\Cache;
  3. use Shopware\Core\Framework\Log\Package;
  4. use Symfony\Component\Cache\CacheItem;
  5. /**
  6.  * @template TCachedContent
  7.  */
  8. #[Package('core')]
  9. class CacheCompressor
  10. {
  11.     /**
  12.      * @param TCachedContent $content
  13.      */
  14.     public static function compress(CacheItem $item$content): CacheItem
  15.     {
  16.         $item->set(CacheValueCompressor::compress($content));
  17.         return $item;
  18.     }
  19.     /**
  20.      * @return TCachedContent
  21.      */
  22.     public static function uncompress(CacheItem $item)
  23.     {
  24.         /** @var TCachedContent|string $value */
  25.         $value $item->get();
  26.         return CacheValueCompressor::uncompress($value);
  27.     }
  28. }