Skip to content

Commit

Permalink
fixed psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Jul 19, 2022
1 parent 21c0757 commit a4a3a20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class Money implements Arrayable, Castable, Jsonable, JsonSerializable, Renderab

protected bool $mutable = false;

protected static ?string $locale;
protected static string $locale;

/**
* Create a new instance.
Expand Down Expand Up @@ -306,7 +306,7 @@ public static function getLocale(): string

public static function setLocale(?string $locale): void
{
static::$locale = str_replace('-', '_', $locale);
static::$locale = str_replace('-', '_', (string) $locale);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/MoneyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testStringThrowsException()

public function testLocale()
{
Money::setLocale('');
Money::setLocale(null);
$this->assertEquals('en_GB', Money::getLocale());
Money::setLocale('en_US');
$this->assertEquals('en_US', Money::getLocale());
Expand Down

0 comments on commit a4a3a20

Please sign in to comment.