/** * @param Request $request * @param \Exception|null $previous */ public function __construct(Request $request, \Exception $previous = null) { $this->request = $request; if (null !== $previous && is_a($previous, 'GuzzleHttp\\Exception\\RequestException')) { $message = sprintf('The request to path "%s" with query parameters "%s" failed to return a valid response. The previous exception reported "%s" at "%s:%d".', $request->getPath(), json_encode($request->getParameters()->all()), $previous->getMessage(), $previous->getFile(), $previous->getLine()); } else { $message = sprintf('The request to path "%s" with query parameters "%s" failed to return a valid response.', $request->getPath(), json_encode($request->getParameters()->all())); } parent::__construct($message, 0, $previous); }
/** * @return ParameterBag */ public function getParameters() { return $this->request->getParameters(); }
/** * Format the request for Guzzle. * * @param Request $request * * @return array */ public function getConfiguration(Request $request) { $this->request = $request; return ['headers' => $request->getHeaders()->all(), 'query' => $request->getParameters()->all()]; }