Skip to content

Commit

Permalink
Merge in main
Browse files Browse the repository at this point in the history
  • Loading branch information
pelmered committed May 8, 2024
2 parents b43c9d9 + bd8a698 commit 3d52c98
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 28 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"require-dev": {
"phpunit/phpunit": "^10 || ^11",
"filament/filament": "^3.0",
"orchestra/testbench": "8.x-dev"
"orchestra/testbench": "8.x-dev",
"phpstan/phpstan": "^1.10"
},
"extra": {
"laravel": {
Expand All @@ -42,6 +43,7 @@
}
},
"scripts": {
"phpstan": "vendor/bin/phpstan analyse src --level=9",
"post-autoload-dump": [
"@clear",
"@prepare"
Expand Down
26 changes: 11 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<directory>tests</directory>
</testsuite>
</testsuites>
<php>
<env name="XDEBUG_MODE" value="debug,develop,coverage"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
<php>
<env name="XDEBUG_MODE" value="debug,develop,coverage"/>
</php>
</phpunit>
4 changes: 2 additions & 2 deletions src/Forms/Components/MoneyInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use Illuminate\Support\Facades\Config;
use Pelmered\FilamentMoneyField\Forms\Rules\MaxValueRule;
use Pelmered\FilamentMoneyField\Forms\Rules\MinValueRule;
use Pelmered\FilamentMoneyField\hasMoneyAttributes;
use Pelmered\FilamentMoneyField\HasMoneyAttributes;
use Pelmered\FilamentMoneyField\MoneyFormatter;

class MoneyInput extends TextInput
{
use hasMoneyAttributes;
use HasMoneyAttributes;

protected function setUp(): void
{
Expand Down
6 changes: 3 additions & 3 deletions src/hasMoneyAttributes.php → src/HasMoneyAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Money\Currencies\ISOCurrencies;
use Money\Currency;

trait hasMoneyAttributes
trait HasMoneyAttributes
{
protected Currency $currency;
protected string $locale;
Expand All @@ -24,7 +24,7 @@ public function getLocale(): string

public function currency(string|\Closure|null $currencyCode = null): static
{
$this->currency = new Currency($currencyCode);
$this->currency = new Currency($this->evaluate($currencyCode));
$currencies = new ISOCurrencies();

if (!$currencies->contains($this->currency)) {
Expand All @@ -36,7 +36,7 @@ public function currency(string|\Closure|null $currencyCode = null): static

public function locale(string|\Closure|null $locale = null): static
{
$this->locale = $locale;
$this->locale = $this->evaluate($locale);

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Infolists/Components/MoneyEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace Pelmered\FilamentMoneyField\Infolists\Components;

use Filament\Infolists\Components\TextEntry;
use Pelmered\FilamentMoneyField\hasMoneyAttributes;
use Pelmered\FilamentMoneyField\HasMoneyAttributes;
use Pelmered\FilamentMoneyField\MoneyFormatter;

class MoneyEntry extends TextEntry
{
use hasMoneyAttributes;
use HasMoneyAttributes;

protected function setUp(): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Tables/Columns/MoneyColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace Pelmered\FilamentMoneyField\Tables\Columns;

use Filament\Tables\Columns\TextColumn;
use Pelmered\FilamentMoneyField\hasMoneyAttributes;
use Pelmered\FilamentMoneyField\HasMoneyAttributes;
use Pelmered\FilamentMoneyField\MoneyFormatter;

class MoneyColumn extends TextColumn
{
use hasMoneyAttributes;
use HasMoneyAttributes;

protected function setUp(): void
{
Expand Down

0 comments on commit 3d52c98

Please sign in to comment.