Skip to content

Commit 37acbee

Browse files
committed
fixes
1 parent cdd2b6d commit 37acbee

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"wallet",
1313
"payments"
1414
],
15-
"minimum-stability": "stable",
15+
"minimum-stability": "dev",
16+
"prefer-stable": true,
1617
"homepage": "https://bavix.github.io/laravel-wallet/",
1718
"license": "MIT",
1819
"authors": [
@@ -26,14 +27,12 @@
2627
"ext-json": "*",
2728
"ext-pdo": "*",
2829
"brick/math": "~0.10",
29-
"doctrine/dbal": "^3.5",
30-
"illuminate/contracts": "^10.0",
31-
"illuminate/database": "^10.0",
30+
"illuminate/contracts": "^10.0|^11.0",
31+
"illuminate/database": "^10.0|^11.0",
3232
"ramsey/uuid": "^4.0"
3333
},
3434
"require-dev": {
3535
"brianium/paratest": "^7.2",
36-
"cknow/laravel-money": "^7.1",
3736
"ergebnis/phpstan-rules": "^1.0",
3837
"infection/infection": "~0.27",
3938
"laravel/cashier": "^15.0",
@@ -47,7 +46,9 @@
4746
},
4847
"suggest": {
4948
"bavix/laravel-wallet-swap": "Addition to the laravel-wallet library for quick setting of exchange rates",
50-
"bavix/laravel-wallet-warmup": "Addition to the laravel-wallet library for refresh balance wallets"
49+
"bavix/laravel-wallet-uuid": "Addition to the laravel-wallet library uuid support in laravel-wallet",
50+
"bavix/laravel-wallet-warmup": "Addition to the laravel-wallet library for refresh balance wallets",
51+
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^3.5.1)."
5152
},
5253
"autoload": {
5354
"psr-4": {

tests/Infra/PackageModels/TransactionMoney.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Bavix\Wallet\Test\Infra\PackageModels;
66

7-
use Cknow\Money\Money;
7+
use Bavix\Wallet\Test\Infra\Values\Money;
88

99
/**
1010
* Class Transaction.
@@ -17,7 +17,7 @@ final class TransactionMoney extends \Bavix\Wallet\Models\Transaction
1717

1818
public function getCurrencyAttribute(): Money
1919
{
20-
$this->currency ??= \money($this->amount, $this->meta['currency'] ?? 'USD');
20+
$this->currency ??= new Money($this->amount, $this->meta['currency'] ?? 'USD');
2121

2222
return $this->currency;
2323
}

tests/Infra/Values/Money.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Bavix\Wallet\Test\Infra\Values;
6+
7+
final class Money
8+
{
9+
public function __construct(
10+
public readonly string $amount,
11+
public readonly string $currency,
12+
) {
13+
}
14+
}

tests/Units/Domain/WalletExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public function testTransactionMoneyAttribute(): void
5353
self::assertTrue($transaction->getKey() > 0);
5454
self::assertSame($transaction->amountInt, $buyer->balanceInt);
5555
self::assertInstanceOf(TransactionMoney::class, $transaction);
56-
self::assertSame('1000', $transaction->currency->getAmount());
57-
self::assertSame('EUR', $transaction->currency->getCurrency()->getCode());
56+
self::assertSame('1000', $transaction->currency->amount);
57+
self::assertSame('EUR', $transaction->currency->currency);
5858
}
5959

6060
public function testNoCustomAttribute(): void

0 commit comments

Comments
 (0)