Skip to content

Commit 3299789

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 33971a6 + 7ec227f commit 3299789

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

src/Commands/RefreshBalance.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RefreshBalance extends Command
3434
*/
3535
public function handle(): void
3636
{
37-
DB::transaction(static function () {
37+
DB::transaction(static function() {
3838
$wallet = config('wallet.wallet.table');
3939
$trans = config('wallet.transaction.table');
4040

@@ -43,7 +43,7 @@ public function handle(): void
4343
->where('confirmed', true)
4444
->groupBy('wallet_id');
4545

46-
$joinClause = static function (JoinClause $join) use ($wallet) {
46+
$joinClause = static function(JoinClause $join) use ($wallet) {
4747
$join->on("$wallet.id", '=', 'b.wallet_id');
4848
};
4949

src/Services/CommonService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function multiOperation(Wallet $self, array $operations): array
173173
public function assemble(array $brings): array
174174
{
175175
$self = $this;
176-
return DB::transaction(static function () use ($self, $brings) {
176+
return DB::transaction(static function() use ($self, $brings) {
177177
return $self->multiBrings($brings);
178178
});
179179
}

src/Services/WalletService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function fee(Wallet $wallet, int $amount): int
3535
$result = 0;
3636

3737
if ($wallet instanceof Taxable) {
38-
$result = (int)($amount * $wallet->getFeePercent() / 100);
38+
$result = (int) ($amount * $wallet->getFeePercent() / 100);
3939

4040
/**
4141
* Added minimum commission condition
@@ -97,7 +97,7 @@ public function getBalance(Wallet $object): int
9797
$wallet = $this->getWallet($object);
9898
$proxy = app(ProxyService::class);
9999
if (!$proxy->has($wallet->getKey())) {
100-
$proxy->set($wallet->getKey(), (int)$wallet->getOriginal('balance', 0));
100+
$proxy->set($wallet->getKey(), (int) $wallet->getOriginal('balance', 0));
101101
}
102102

103103
return $proxy[$wallet->getKey()];

src/Traits/CanConfirm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ trait CanConfirm
2020
public function confirm(Transaction $transaction): bool
2121
{
2222
$self = $this;
23-
return DB::transaction(static function () use ($self, $transaction) {
23+
return DB::transaction(static function() use ($self, $transaction) {
2424
$wallet = app(WalletService::class)
2525
->getWallet($self);
2626

@@ -63,7 +63,7 @@ public function safeConfirm(Transaction $transaction): bool
6363
public function forceConfirm(Transaction $transaction): bool
6464
{
6565
$self = $this;
66-
return DB::transaction(static function () use ($self, $transaction) {
66+
return DB::transaction(static function() use ($self, $transaction) {
6767

6868
$wallet = app(WalletService::class)
6969
->getWallet($self);

src/Traits/CanExchange.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function forceExchange(Wallet $to, int $amount, ?array $meta = null): Tra
4949
*/
5050
$from = app(WalletService::class)->getWallet($this);
5151

52-
return DB::transaction(static function () use ($from, $to, $amount, $meta) {
52+
return DB::transaction(static function() use ($from, $to, $amount, $meta) {
5353
$rate = app(ExchangeService::class)->rate($from, $to);
5454
$fee = app(WalletService::class)->fee($to, $amount);
5555

src/Traits/CartPay.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function payFreeCart(Cart $cart): array
3232
->verifyWithdraw($this, 0);
3333

3434
$self = $this;
35-
return DB::transaction(static function () use ($self, $cart) {
35+
return DB::transaction(static function() use ($self, $cart) {
3636
$results = [];
3737
foreach ($cart->getItems() as $product) {
3838
$results[] = app(CommonService::class)->forceTransfer(
@@ -75,7 +75,7 @@ public function payCart(Cart $cart, bool $force = null): array
7575
}
7676

7777
$self = $this;
78-
return DB::transaction(static function () use ($self, $cart, $force) {
78+
return DB::transaction(static function() use ($self, $cart, $force) {
7979
$results = [];
8080
foreach ($cart->getItems() as $product) {
8181
if ($force) {
@@ -138,7 +138,7 @@ public function safeRefundCart(Cart $cart, bool $force = null, bool $gifts = nul
138138
public function refundCart(Cart $cart, bool $force = null, bool $gifts = null): bool
139139
{
140140
$self = $this;
141-
return DB::transaction(static function () use ($self, $cart, $force, $gifts) {
141+
return DB::transaction(static function() use ($self, $cart, $force, $gifts) {
142142
$results = [];
143143
$transfers = $cart->alreadyBuy($self, $gifts);
144144
if (count($transfers) !== count($cart)) {

src/Traits/HasGift.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function gift(Wallet $to, Product $product, bool $force = null): Transfer
6161
* I think it is wrong to make the "assemble" method public.
6262
* That's why I address him like this!
6363
*/
64-
return DB::transaction(static function () use ($santa, $to, $product, $force) {
64+
return DB::transaction(static function() use ($santa, $to, $product, $force) {
6565
$amount = $product->getAmountProduct();
6666
$meta = $product->getMetaProduct();
6767
$fee = app(WalletService::class)

src/Traits/HasWallet.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ trait HasWallet
4040
public function deposit(int $amount, ?array $meta = null, bool $confirmed = true): Transaction
4141
{
4242
$self = $this;
43-
return DB::transaction(static function () use ($self, $amount, $meta, $confirmed) {
43+
return DB::transaction(static function() use ($self, $amount, $meta, $confirmed) {
4444
return app(CommonService::class)
4545
->deposit($self, $amount, $meta, $confirmed);
4646
});
@@ -156,7 +156,7 @@ public function canWithdraw(int $amount): bool
156156
public function forceWithdraw(int $amount, ?array $meta = null, bool $confirmed = true): Transaction
157157
{
158158
$self = $this;
159-
return DB::transaction(static function () use ($self, $amount, $meta, $confirmed) {
159+
return DB::transaction(static function() use ($self, $amount, $meta, $confirmed) {
160160
return app(CommonService::class)
161161
->forceWithdraw($self, $amount, $meta, $confirmed);
162162
});
@@ -174,7 +174,7 @@ public function forceWithdraw(int $amount, ?array $meta = null, bool $confirmed
174174
public function forceTransfer(Wallet $wallet, int $amount, ?array $meta = null): Transfer
175175
{
176176
$self = $this;
177-
return DB::transaction(static function () use ($self, $amount, $wallet, $meta) {
177+
return DB::transaction(static function() use ($self, $amount, $wallet, $meta) {
178178
return app(CommonService::class)
179179
->forceTransfer($self, $wallet, $amount, $meta);
180180
});

src/Traits/HasWallets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function createWallet(array $data): WalletModel
105105
*/
106106
public function hasWallet(string $slug): bool
107107
{
108-
return (bool)$this->getWallet($slug);
108+
return (bool) $this->getWallet($slug);
109109
}
110110

111111
}

0 commit comments

Comments
 (0)