/** * @param string $id * @return string * @throws StorageException */ public function read(string $id) : string { $read = $this->cache->get("sess_" . $id); if (empty($read)) { throw StorageException::readError(__METHOD__, 'Not found'); } return $read; }
/** * @param string $id * @return string * @throws StorageException */ public function read(string $id) : string { $read = call_user_func([$this, "findById"], $id); if (!is_array($read) || !array_key_exists("payload", $read) || empty($read["payload"])) { throw StorageException::readError(__METHOD__, 'Not found'); } return $read["payload"]; }