Skip to content

Commit

Permalink
Remove object creating from getCurrecncies method
Browse files Browse the repository at this point in the history
  • Loading branch information
agalstian committed Dec 5, 2019
1 parent e959906 commit fd6c023
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -1565,8 +1565,7 @@ public static function addCurrency(
int $defaultFractionDigits,
int $subUnit,
bool $deprecated = false
): void
{
): void {
self::$currencies[$code] = [
'display_name' => $displayName,
'numeric_code' => $numericCode,
Expand All @@ -1584,7 +1583,7 @@ public static function getCurrencies(): array
return array_filter(
self::$currencies,
function ($currencyCode) {
return !(new Currency($currencyCode))->isDeprecated();
return !self::$currencies[$currencyCode]['deprecated'];
},
ARRAY_FILTER_USE_KEY
);
Expand Down

0 comments on commit fd6c023

Please sign in to comment.