getStats(); return $this->formatStats($cache, $stats); } /** * @param ExtendedCacheItemPoolInterface $cache * @param DriverStatistic $stats * * @return array * @throws \ACPT_Lite\Vendor\Phpfastcache\Exceptions\PhpfastcacheInvalidArgumentException */ private function formatStats(ExtendedCacheItemPoolInterface $cache, DriverStatistic $stats): array { $data = explode(", ", $stats->getData()); $items = []; foreach ($data as $key) { $item = $cache->getItem($key); $items[] = [ 'key' => $key, 'tags' => $item->getTagsAsString(), 'data' => $item->getDataAsJsonString(), ]; } return [ "info" => $stats->getInfo(), "size" => Strings::bytesToHumanReadable($stats->getSize()), "itemsCount" => Arrays::count($data), "items" => $items, ]; } }