redisService->get($this->redisKey), JSON_OBJECT_AS_ARRAY); if (!isset($usds[$date->format('Y-m-d')])) { throw new EmptyRedis($this->redisKey); } $usd = $usds[$date->format('Y-m-d')]; } catch (EmptyRedis) { $usd = $this->moneyService->getUSD($date); $usds[$date->format('Y-m-d')] = $usd; ksort($usds); $this->redisService->set($this->redisKey, json_encode($usds), 60 * 60 * 24 * 30); } return $usd; } }