Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Utility;
- use App\Entity\ExchangeRate;
- use DateTime;
- class Utility
- {
- //... Declaration of Constants
- //... Declaration of curlExchangeRates function
- //... Declaration of processExchangeRates function
- //... getExchangeRateArray function
- public function getExchangeRates(DateTime $earliestDate = null): array
- {
- $curlResponse = $this->curlExchangeRates();
- if (!$curlResponse) return []; //if something went wrong with curlExchangeRates, return an empty array
- $rateString = $this->processExchangeRates($curlResponse, $earliestDate);
- return $this->getExchangeRateArray($rateString);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement