Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ariaieboy authored and github-actions[bot] committed Nov 3, 2024
1 parent 4e64365 commit 0c00226
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/filament-currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
* we use it in the fallback to support the laravel-money version 5.
*/
'default_currency' => env('CURRENCY_DEFAULT', env('MONEY_DEFAULTS_CURRENCY', config('money.defaults.currency', 'USD'))),
'default_convert'=>env('MONEY_DEFAULTS_CONVERT',false)
'default_convert' => env('MONEY_DEFAULTS_CONVERT', false),
];
11 changes: 6 additions & 5 deletions src/FilamentCurrencyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ public function bootingPackage(): void
if (blank($currency)) {
$currency = config('filament-currency.default_currency');
}
if (is_null($shouldConvert)){
if (is_null($shouldConvert)) {
$shouldConvert = config('filament-currency.default_convert');
}

return (new Money\Money(
$state,
(new Money\Currency(strtoupper($evaluator->evaluate($currency)))),
$shouldConvert,
))->format();
};

TextColumn::macro('currency', function (string | Closure | null $currency = null, bool|null $shouldConvert = null) use ($formatter): TextColumn {
TextColumn::macro('currency', function (string | Closure | null $currency = null, ?bool $shouldConvert = null) use ($formatter): TextColumn {
/**
* @var TextColumn $this
*/
Expand All @@ -58,7 +59,7 @@ public function bootingPackage(): void

return $this;
});
Summarizers\Sum::macro('currency', function (string | Closure | null $currency = null, bool|null $shouldConvert = null) use ($formatter): Summarizers\Sum {
Summarizers\Sum::macro('currency', function (string | Closure | null $currency = null, ?bool $shouldConvert = null) use ($formatter): Summarizers\Sum {
/**
* @var Summarizers\Sum $this
*/
Expand All @@ -71,7 +72,7 @@ public function bootingPackage(): void
return $this;
});

Summarizers\Average::macro('currency', function (string | Closure | null $currency = null, bool|null $shouldConvert = null) use ($formatter): Summarizers\Average {
Summarizers\Average::macro('currency', function (string | Closure | null $currency = null, ?bool $shouldConvert = null) use ($formatter): Summarizers\Average {
/**
* @var Summarizers\Average $this
*/
Expand All @@ -84,7 +85,7 @@ public function bootingPackage(): void
return $this;
});

TextEntry::macro('currency', function (string | Closure | null $currency = null, bool|null $shouldConvert = null) use ($formatter): TextEntry {
TextEntry::macro('currency', function (string | Closure | null $currency = null, ?bool $shouldConvert = null) use ($formatter): TextEntry {
/**
* @var TextEntry $this
*/
Expand Down

0 comments on commit 0c00226

Please sign in to comment.