FIX: Cartolas not adding Movimientos or adding cargos and abonos
This commit is contained in:
@ -12,6 +12,9 @@ class MiIndicador implements Provider
|
||||
public function __construct(protected ClientInterface $client) {}
|
||||
|
||||
/**
|
||||
* @param string $money_symbol
|
||||
* @param DateTimeInterface|null $dateTime
|
||||
* @return float
|
||||
* @throws EmptyResponse
|
||||
*/
|
||||
public function get(string $money_symbol, ?DateTimeInterface $dateTime = null): float
|
||||
@ -33,7 +36,7 @@ class MiIndicador implements Provider
|
||||
$body = $response->getBody();
|
||||
$json = json_decode($body->getContents());
|
||||
|
||||
if (empty($json) or $json->codigo !== $money_symbol or count($json->serie) === 0) {
|
||||
if (empty($json) or !isset($json->codigo) or !isset($json->serie) or $json->codigo !== $money_symbol or count($json->serie) === 0) {
|
||||
throw new EmptyResponse($request_uri);
|
||||
}
|
||||
return $json->serie[0]->valor;
|
||||
|
||||
Reference in New Issue
Block a user