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 (empty($json) or $json->codigo !== $money_symbol or count($json->serie) === 0) { throw new EmptyResponse($request_uri); } return $json->serie[0]->valor; } public static function getSymbol(string $identifier): string { $upper = strtoupper($identifier); $output = ''; eval("\$output = self::{$upper};"); return $output; } }