method, $decoded->params ?? null); } elseif (Request::isRequest($decoded)) { /** @psalm-suppress MixedArgument */ $obj = new Request($decoded->id, $decoded->method, $decoded->params ?? null); } elseif (SuccessResponse::isSuccessResponse($decoded)) { /** @psalm-suppress MixedArgument */ $obj = new SuccessResponse($decoded->id, $decoded->result); } elseif (ErrorResponse::isErrorResponse($decoded)) { /** @psalm-suppress MixedArgument, MixedPropertyFetch */ $obj = new ErrorResponse($decoded->id, new Error($decoded->error->message, $decoded->error->code, $decoded->error->data ?? null)); } else { throw new Error('Invalid message', ErrorCode::INVALID_REQUEST); } return $obj; } }