mirror of
https://github.com/archtechx/money.git
synced 2025-12-14 03:54:03 +00:00
Fix PHPStan errors
This commit is contained in:
parent
3079fcdf48
commit
dfce704a2e
3 changed files with 6 additions and 1 deletions
|
|
@ -128,7 +128,10 @@ trait RegistersCurrencies
|
||||||
}
|
}
|
||||||
|
|
||||||
if (class_exists($currency) && (new ReflectionClass($currency))->isSubclassOf(Currency::class)) {
|
if (class_exists($currency) && (new ReflectionClass($currency))->isSubclassOf(Currency::class)) {
|
||||||
return (new $currency)->code();
|
/** @var Currency $currency * */
|
||||||
|
$currency = new $currency;
|
||||||
|
|
||||||
|
return $currency->code();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidCurrencyException(
|
throw new InvalidCurrencyException(
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ use ArchTech\Money\Exceptions\InvalidCurrencyException;
|
||||||
use Illuminate\Contracts\Support\Arrayable;
|
use Illuminate\Contracts\Support\Arrayable;
|
||||||
use JsonSerializable;
|
use JsonSerializable;
|
||||||
|
|
||||||
|
/** @implements Arrayable<string, string|int|float> */
|
||||||
class Currency implements Arrayable, JsonSerializable
|
class Currency implements Arrayable, JsonSerializable
|
||||||
{
|
{
|
||||||
/** Code of the currency (e.g. 'CZK'). */
|
/** Code of the currency (e.g. 'CZK'). */
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ use Illuminate\Contracts\Support\Arrayable;
|
||||||
use JsonSerializable;
|
use JsonSerializable;
|
||||||
use Livewire\Wireable;
|
use Livewire\Wireable;
|
||||||
|
|
||||||
|
/** @implements Arrayable<string, string|int> */
|
||||||
final class Money implements JsonSerializable, Arrayable, Wireable
|
final class Money implements JsonSerializable, Arrayable, Wireable
|
||||||
{
|
{
|
||||||
protected int $value;
|
protected int $value;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue