mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 14:38:39 +00:00
be more defensive about array index
This commit is contained in:
parent
88938b7fd1
commit
092c9b9f29
|
|
@ -115,7 +115,12 @@ final class Currency
|
||||||
self::$ecbCurrencies = [];
|
self::$ecbCurrencies = [];
|
||||||
|
|
||||||
foreach ($node as $key => $value) {
|
foreach ($node as $key => $value) {
|
||||||
self::$ecbCurrencies[\strtoupper((string) $value->attributes()['currency'])] = (float) $value->attributes()['rate'];
|
/** @var null|array<string, string|int|float> $attributes */
|
||||||
|
if (($attributes = $value->attributes()) === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
self::$ecbCurrencies[\strtoupper((string) ($attributes['currency']))] = (float) ($attributes['rate']);
|
||||||
}
|
}
|
||||||
} catch (\Throwable $t) {
|
} catch (\Throwable $t) {
|
||||||
self::$ecbCurrencies = []; // @codeCoverageIgnore
|
self::$ecbCurrencies = []; // @codeCoverageIgnore
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user