cyxc
This commit is contained in:
@@ -310,13 +310,6 @@ final class FxService
|
||||
return $shared->refreshCurrencyCatalog();
|
||||
}
|
||||
|
||||
if ($this->repository === null) {
|
||||
return [
|
||||
'synced_count' => 0,
|
||||
'currencies' => [],
|
||||
];
|
||||
}
|
||||
|
||||
$payload = $this->fetchCurrenciesPayload();
|
||||
$items = is_array($payload['currencies'] ?? null) ? $payload['currencies'] : [];
|
||||
if ($items === []) {
|
||||
@@ -349,8 +342,6 @@ final class FxService
|
||||
$sortOrder++;
|
||||
}
|
||||
|
||||
$this->repository->saveCurrencies($synced);
|
||||
|
||||
usort($synced, static function (array $left, array $right): int {
|
||||
return [$left['sort_order'], $left['code']] <=> [$right['sort_order'], $right['code']];
|
||||
});
|
||||
@@ -796,16 +787,7 @@ final class FxService
|
||||
|
||||
private function defaultCurrencies(): array
|
||||
{
|
||||
if ($this->repository === null) {
|
||||
return ['EUR', 'USD'];
|
||||
}
|
||||
|
||||
try {
|
||||
$currencies = $this->repository->listActiveFiatCurrencies();
|
||||
return array_map(static fn (array $currency): string => (string) $currency['code'], $currencies);
|
||||
} catch (\Throwable) {
|
||||
return ['EUR', 'USD'];
|
||||
}
|
||||
return ['EUR', 'USD'];
|
||||
}
|
||||
|
||||
private function normalizeRateDate(mixed $value): string
|
||||
|
||||
Reference in New Issue
Block a user