@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function forceWithdrawFloat(float $amount, ?array $meta = null, bool $confirmed = true): Transaction |
29 | 29 | { |
30 | 30 | $decimalPlaces = app(WalletService::class)->decimalPlaces($this); |
31 | - return $this->forceWithdraw((int)round($amount * $decimalPlaces), $meta, $confirmed); |
|
31 | + return $this->forceWithdraw((int) round($amount * $decimalPlaces), $meta, $confirmed); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function depositFloat(float $amount, ?array $meta = null, bool $confirmed = true): Transaction |
42 | 42 | { |
43 | 43 | $decimalPlaces = app(WalletService::class)->decimalPlaces($this); |
44 | - return $this->deposit((int)round($amount * $decimalPlaces), $meta, $confirmed); |
|
44 | + return $this->deposit((int) round($amount * $decimalPlaces), $meta, $confirmed); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function withdrawFloat(float $amount, ?array $meta = null, bool $confirmed = true): Transaction |
55 | 55 | { |
56 | 56 | $decimalPlaces = app(WalletService::class)->decimalPlaces($this); |
57 | - return $this->withdraw((int)round($amount * $decimalPlaces), $meta, $confirmed); |
|
57 | + return $this->withdraw((int) round($amount * $decimalPlaces), $meta, $confirmed); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | public function canWithdrawFloat(float $amount): bool |
65 | 65 | { |
66 | 66 | $decimalPlaces = app(WalletService::class)->decimalPlaces($this); |
67 | - return $this->canWithdraw((int)round($amount * $decimalPlaces)); |
|
67 | + return $this->canWithdraw((int) round($amount * $decimalPlaces)); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function transferFloat(Wallet $wallet, float $amount, ?array $meta = null): Transfer |
78 | 78 | { |
79 | 79 | $decimalPlaces = app(WalletService::class)->decimalPlaces($this); |
80 | - return $this->transfer($wallet, (int)round($amount * $decimalPlaces), $meta); |
|
80 | + return $this->transfer($wallet, (int) round($amount * $decimalPlaces), $meta); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | public function safeTransferFloat(Wallet $wallet, float $amount, ?array $meta = null): ?Transfer |
90 | 90 | { |
91 | 91 | $decimalPlaces = app(WalletService::class)->decimalPlaces($this); |
92 | - return $this->safeTransfer($wallet, (int)round($amount * $decimalPlaces), $meta); |
|
92 | + return $this->safeTransfer($wallet, (int) round($amount * $decimalPlaces), $meta); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | public function forceTransferFloat(Wallet $wallet, float $amount, ?array $meta = null): Transfer |
102 | 102 | { |
103 | 103 | $decimalPlaces = app(WalletService::class)->decimalPlaces($this); |
104 | - return $this->forceTransfer($wallet, (int)round($amount * $decimalPlaces), $meta); |
|
104 | + return $this->forceTransfer($wallet, (int) round($amount * $decimalPlaces), $meta); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -174,7 +174,7 @@ |
||
174 | 174 | public function assemble(array $brings): array |
175 | 175 | { |
176 | 176 | $self = $this; |
177 | - return DB::transaction(static function() use ($self, $brings) { |
|
177 | + return DB::transaction(static function () use ($self, $brings) { |
|
178 | 178 | return $self->multiBrings($brings); |
179 | 179 | }); |
180 | 180 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function handle(): void |
39 | 39 | { |
40 | 40 | app(ProxyService::class)->fresh(); |
41 | - DB::transaction(function() { |
|
41 | + DB::transaction(function () { |
|
42 | 42 | $wallet = config('wallet.wallet.table'); |
43 | 43 | DB::table($wallet)->update(['balance' => 0]); |
44 | 44 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ->where('confirmed', true) |
77 | 77 | ->groupBy('wallet_id'); |
78 | 78 | |
79 | - $joinClause = static function(JoinClause $join) use ($wallet) { |
|
79 | + $joinClause = static function (JoinClause $join) use ($wallet) { |
|
80 | 80 | $join->on("$wallet.id", '=', 'b.wallet_id'); |
81 | 81 | }; |
82 | 82 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function confirm(Transaction $transaction): bool |
21 | 21 | { |
22 | 22 | $self = $this; |
23 | - return DB::transaction(static function() use ($self, $transaction) { |
|
23 | + return DB::transaction(static function () use ($self, $transaction) { |
|
24 | 24 | $wallet = app(WalletService::class) |
25 | 25 | ->getWallet($self); |
26 | 26 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function forceConfirm(Transaction $transaction): bool |
62 | 62 | { |
63 | 63 | $self = $this; |
64 | - return DB::transaction(static function() use ($self, $transaction) { |
|
64 | + return DB::transaction(static function () use ($self, $transaction) { |
|
65 | 65 | |
66 | 66 | $wallet = app(WalletService::class) |
67 | 67 | ->getWallet($self); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | $from = app(WalletService::class)->getWallet($this); |
51 | 51 | |
52 | - return DB::transaction(static function() use ($from, $to, $amount, $meta) { |
|
52 | + return DB::transaction(static function () use ($from, $to, $amount, $meta) { |
|
53 | 53 | $rate = app(ExchangeService::class)->rate($from, $to); |
54 | 54 | $fee = app(WalletService::class)->fee($to, $amount); |
55 | 55 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function deposit(int $amount, ?array $meta = null, bool $confirmed = true): Transaction |
42 | 42 | { |
43 | 43 | $self = $this; |
44 | - return DB::transaction(static function() use ($self, $amount, $meta, $confirmed) { |
|
44 | + return DB::transaction(static function () use ($self, $amount, $meta, $confirmed) { |
|
45 | 45 | return app(CommonService::class) |
46 | 46 | ->deposit($self, $amount, $meta, $confirmed); |
47 | 47 | }); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | public function forceWithdraw(int $amount, ?array $meta = null, bool $confirmed = true): Transaction |
166 | 166 | { |
167 | 167 | $self = $this; |
168 | - return DB::transaction(static function() use ($self, $amount, $meta, $confirmed) { |
|
168 | + return DB::transaction(static function () use ($self, $amount, $meta, $confirmed) { |
|
169 | 169 | return app(CommonService::class) |
170 | 170 | ->forceWithdraw($self, $amount, $meta, $confirmed); |
171 | 171 | }); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | public function forceTransfer(Wallet $wallet, int $amount, ?array $meta = null): Transfer |
184 | 184 | { |
185 | 185 | $self = $this; |
186 | - return DB::transaction(static function() use ($self, $amount, $wallet, $meta) { |
|
186 | + return DB::transaction(static function () use ($self, $amount, $wallet, $meta) { |
|
187 | 187 | return app(CommonService::class) |
188 | 188 | ->forceTransfer($self, $wallet, $amount, $meta); |
189 | 189 | }); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | ->verifyWithdraw($this, 0, true); |
33 | 33 | |
34 | 34 | $self = $this; |
35 | - return DB::transaction(static function() use ($self, $cart) { |
|
35 | + return DB::transaction(static function () use ($self, $cart) { |
|
36 | 36 | $results = []; |
37 | 37 | foreach ($cart->getItems() as $product) { |
38 | 38 | $results[] = app(CommonService::class)->forceTransfer( |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | $self = $this; |
78 | - return DB::transaction(static function() use ($self, $cart, $force) { |
|
78 | + return DB::transaction(static function () use ($self, $cart, $force) { |
|
79 | 79 | $results = []; |
80 | 80 | foreach ($cart->getItems() as $product) { |
81 | 81 | if ($force) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | public function refundCart(Cart $cart, bool $force = null, bool $gifts = null): bool |
139 | 139 | { |
140 | 140 | $self = $this; |
141 | - return DB::transaction(static function() use ($self, $cart, $force, $gifts) { |
|
141 | + return DB::transaction(static function () use ($self, $cart, $force, $gifts) { |
|
142 | 142 | $results = []; |
143 | 143 | $transfers = $cart->alreadyBuy($self, $gifts); |
144 | 144 | if (count($transfers) !== count($cart)) { |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * I think it is wrong to make the "assemble" method public. |
62 | 62 | * That's why I address him like this! |
63 | 63 | */ |
64 | - return DB::transaction(static function() use ($santa, $to, $product, $force) { |
|
64 | + return DB::transaction(static function () use ($santa, $to, $product, $force) { |
|
65 | 65 | $amount = $product->getAmountProduct(); |
66 | 66 | $meta = $product->getMetaProduct(); |
67 | 67 | $fee = app(WalletService::class) |