Skip to content

Commit 468bc2c

Browse files
author
Babichev Maxim
committed
Merge remote-tracking branch 'origin/3.1' into 3.1
2 parents becb737 + c69957a commit 468bc2c

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
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(function () {
37+
DB::transaction(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 = function (JoinClause $join) use ($wallet) {
46+
$joinClause = 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
@@ -172,7 +172,7 @@ public function multiOperation(Wallet $self, array $operations): array
172172
*/
173173
public function assemble(array $brings): array
174174
{
175-
return DB::transaction(function () use ($brings) {
175+
return DB::transaction(function() use ($brings) {
176176
return $this->multiBrings($brings);
177177
});
178178
}

src/Services/WalletService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class WalletService
2222
public function fee(Wallet $wallet, int $amount): int
2323
{
2424
if ($wallet instanceof Taxable) {
25-
return (int)($amount * $wallet->getFeePercent() / 100);
25+
return (int) ($amount * $wallet->getFeePercent() / 100);
2626
}
2727

2828
return 0;
@@ -67,7 +67,7 @@ public function getBalance(Wallet $object): int
6767
$wallet->exists or $wallet->save();
6868
$proxy = app(ProxyService::class);
6969
if (!$proxy->has($wallet->getKey())) {
70-
$proxy->set($wallet->getKey(), (int)$wallet->getOriginal('balance', 0));
70+
$proxy->set($wallet->getKey(), (int) $wallet->getOriginal('balance', 0));
7171
}
7272

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

src/Traits/CartPay.php

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

34-
return DB::transaction(function () use ($cart) {
34+
return DB::transaction(function() use ($cart) {
3535
$results = [];
3636
foreach ($cart->getItems() as $product) {
3737
$results[] = app(CommonService::class)->forceTransfer(
@@ -73,7 +73,7 @@ public function payCart(Cart $cart, bool $force = null): array
7373
throw new ProductEnded(trans('wallet::errors.product_stock'));
7474
}
7575

76-
return DB::transaction(function () use ($cart, $force) {
76+
return DB::transaction(function() use ($cart, $force) {
7777
$results = [];
7878
foreach ($cart->getItems() as $product) {
7979
if ($force) {
@@ -135,7 +135,7 @@ public function safeRefundCart(Cart $cart, bool $force = null, bool $gifts = nul
135135
*/
136136
public function refundCart(Cart $cart, bool $force = null, bool $gifts = null): bool
137137
{
138-
return DB::transaction(function () use ($cart, $force, $gifts) {
138+
return DB::transaction(function() use ($cart, $force, $gifts) {
139139
$results = [];
140140
$transfers = $cart->alreadyBuy($this, $gifts);
141141
if (count($transfers) !== count($cart)) {

src/Traits/HasGift.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function gift(Wallet $to, Product $product, bool $force = null): Transfer
5959
/**
6060
* @return Transfer
6161
*/
62-
$callback = function () use ($santa, $product, $force) {
62+
$callback = function() use ($santa, $product, $force) {
6363
$amount = $product->getAmountProduct();
6464
$meta = $product->getMetaProduct();
6565
$fee = app(WalletService::class)

src/Traits/HasWallet.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ trait HasWallet
4545
*/
4646
public function deposit(int $amount, ?array $meta = null, bool $confirmed = true): Transaction
4747
{
48-
return DB::transaction(function () use ($amount, $meta, $confirmed) {
48+
return DB::transaction(function() use ($amount, $meta, $confirmed) {
4949
return app(CommonService::class)
5050
->deposit($this, $amount, $meta, $confirmed);
5151
});
@@ -160,7 +160,7 @@ public function canWithdraw(int $amount): bool
160160
*/
161161
public function forceWithdraw(int $amount, ?array $meta = null, bool $confirmed = true): Transaction
162162
{
163-
return DB::transaction(function () use ($amount, $meta, $confirmed) {
163+
return DB::transaction(function() use ($amount, $meta, $confirmed) {
164164
return app(CommonService::class)
165165
->forceWithdraw($this, $amount, $meta, $confirmed);
166166
});
@@ -177,7 +177,7 @@ public function forceWithdraw(int $amount, ?array $meta = null, bool $confirmed
177177
*/
178178
public function forceTransfer(Wallet $wallet, int $amount, ?array $meta = null): Transfer
179179
{
180-
return DB::transaction(function () use ($amount, $wallet, $meta) {
180+
return DB::transaction(function() use ($amount, $wallet, $meta) {
181181
return app(CommonService::class)
182182
->forceTransfer($this, $wallet, $amount, $meta);
183183
});

0 commit comments

Comments
 (0)