format('d-m-Y')}"; try { $response = $this->client->get($request_uri); } catch (GuzzleException) { throw new EmptyResponse($request_uri); } if ((int) floor($response->getStatusCode() / 100) !== 2) { throw new EmptyResponse($request_uri); } $body = $response->getBody(); $json = json_decode($body->getContents()); if ($json->codigo !== $money_symbol or count($json->serie) === 0) { throw new EmptyResponse($request_uri); } return $json->serie[0]->valor; } }