1
0
Fork 0
mirror of https://github.com/archtechx/money.git synced 2025-12-12 19:34:02 +00:00

Fix PHPStan errors

This commit is contained in:
lukinovec 2023-02-15 16:58:39 +01:00
parent 3079fcdf48
commit dfce704a2e
3 changed files with 6 additions and 1 deletions

View file

@ -128,7 +128,10 @@ trait RegistersCurrencies
}
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(

View file

@ -8,6 +8,7 @@ use ArchTech\Money\Exceptions\InvalidCurrencyException;
use Illuminate\Contracts\Support\Arrayable;
use JsonSerializable;
/** @implements Arrayable<string, string|int|float> */
class Currency implements Arrayable, JsonSerializable
{
/** Code of the currency (e.g. 'CZK'). */

View file

@ -8,6 +8,7 @@ use Illuminate\Contracts\Support\Arrayable;
use JsonSerializable;
use Livewire\Wireable;
/** @implements Arrayable<string, string|int> */
final class Money implements JsonSerializable, Arrayable, Wireable
{
protected int $value;