redis->lPush( $this->getRedisKey($message), $this->getRedisContent($message) ); } private function getRedisKey(AddCheepToTimelineProjection $message): string { return sprintf( self::REDIS_KEY_TEMPLATE, $message->authorId ); } private function getRedisContent(AddCheepToTimelineProjection $message): string { return json_encode([ 'cheep_id' => $message->cheepId, 'cheep_message' => $message->cheepMessage, 'cheep_date' => $message->cheepDate, ], JSON_THROW_ON_ERROR); } } //end-snippet