Exemplo n.º 1
0
 /**
  * @param RpcRequestInterface $request
  * @param string $id
  * @return static
  */
 public static function fromRpcRequest(RpcRequestInterface $request, $id)
 {
     return new static($request->getMethod(), $request->getParameters(), $id);
 }
Exemplo n.º 2
0
 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);
 }