/** * @param RpcRequestInterface $request * @param string $id * @return static */ public static function fromRpcRequest(RpcRequestInterface $request, $id) { return new static($request->getMethod(), $request->getParameters(), $id); }
public function getKey(RpcRequestInterface $request) { $data = ['method' => (string) $request->getMethod(), 'params' => json_decode(json_encode($request->getParameters()), true)]; $stringData = json_encode($data); return $this->keyPrefix . sha1($stringData); }