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

Add L10 support (#20)

* Add L10 support

* Upgrade phpstan

* Set `archtechx/helpers` version

* Fix PHPStan errors

* Try using older PHPStan version

* Revert PHPStan downgrade

* Delete immutability tests

* Bring back immutability tests

* Correct typehint

* Update immutability tests

* Remove L8 support

* Allow PHP 8.0, run tests for 8.0 as well

* Swap Laravel 9 & 10

* Add setup-php step

* Revert formatting changes

* Fix formatting

* Revert adding setup-php

* Try adding setup-php

* Change formatting

* Remove PHP 8.0

* Fix formatting
This commit is contained in:
lukinovec 2023-02-16 17:06:45 +01:00 committed by GitHub
parent b1b02f459d
commit b50e49358a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 16 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;