mirror of
https://github.com/archtechx/money.git
synced 2025-12-12 19:34:02 +00:00
Resolve PHP 8.4 deprecations (fix #24)
This commit is contained in:
parent
8a0eeae7c7
commit
b642e32a4b
6 changed files with 22 additions and 23 deletions
|
|
@ -8,7 +8,7 @@ use ArchTech\Money\Money;
|
|||
|
||||
if (! function_exists('money')) {
|
||||
/** Create a Money instance. */
|
||||
function money(int $amount, Currency|string $currency = null): Money
|
||||
function money(int $amount, Currency|string|null $currency = null): Money
|
||||
{
|
||||
return new Money($amount, $currency ?? currencies()->getDefault());
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@ if (! function_exists('money')) {
|
|||
|
||||
if (! function_exists('currency')) {
|
||||
/** Fetch a currency. If no argument is provided, the current currency will be returned. */
|
||||
function currency(Currency|string $currency = null): Currency
|
||||
function currency(Currency|string|null $currency = null): Currency
|
||||
{
|
||||
if ($currency) {
|
||||
return $currency instanceof Currency
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue