@@ -16,7 +16,7 @@ |
||
16 | 16 | * @param float $amount |
17 | 17 | * @return float |
18 | 18 | */ |
19 | - public static function fee(Transferable $transferable, Wallet $wallet,float $amount): float |
|
19 | + public static function fee(Transferable $transferable, Wallet $wallet, float $amount): float |
|
20 | 20 | { |
21 | 21 | if ($transferable instanceof Taxing) { |
22 | 22 | return (float) ($amount * $wallet->coefficient($wallet->currency) * $transferable->getFeePercent() / 100); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | protected function change(string $type, int $amount, ?array $meta, bool $confirmed): Transaction |
67 | 67 | { |
68 | - return DB::transaction(function () use ($type, $amount, $meta, $confirmed) { |
|
68 | + return DB::transaction(function() use ($type, $amount, $meta, $confirmed) { |
|
69 | 69 | if ($confirmed) { |
70 | 70 | $this->addBalance($amount); |
71 | 71 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | $this->exists or $this->save(); |
103 | 103 | |
104 | - if (! WalletProxy::has($this->getKey())) { |
|
104 | + if (!WalletProxy::has($this->getKey())) { |
|
105 | 105 | $balance = $this->attributes['balance'] / $this->coefficient($this->attributes['currency']); |
106 | 106 | WalletProxy::set($this->getKey(), (float) ($balance ?? 0)); |
107 | 107 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $wallet = $transferable->getReceiptWallet($this->currency); |
124 | 124 | |
125 | - return DB::transaction(function () use ($transferable, $amount, $wallet, $meta, $action) { |
|
125 | + return DB::transaction(function() use ($transferable, $amount, $wallet, $meta, $action) { |
|
126 | 126 | $fee = Tax::fee($transferable, $wallet, $amount); |
127 | 127 | $withdraw = $this->withdraw($amount + $fee, $meta); |
128 | 128 | $deposit = $wallet->deposit($amount, $meta); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | public function withdraw(float $amount, ?array $meta = null, bool $confirmed = true): Transaction |
134 | 134 | { |
135 | - if (! $this->canWithdraw($amount)) { |
|
135 | + if (!$this->canWithdraw($amount)) { |
|
136 | 136 | throw new InsufficientFunds(trans('wallet::errors.insufficient_funds')); |
137 | 137 | } |
138 | 138 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | $wallet = $transferable->getReceiptWallet($this->currency); |
176 | 176 | |
177 | - return DB::transaction(function () use ($transferable, $amount, $wallet, $meta, $action) { |
|
177 | + return DB::transaction(function() use ($transferable, $amount, $wallet, $meta, $action) { |
|
178 | 178 | $fee = Tax::fee($transferable, $wallet, $amount); |
179 | 179 | $withdraw = $this->forceWithdraw($amount + $fee, $meta); |
180 | 180 | $deposit = $wallet->deposit($amount, $meta); |
@@ -203,6 +203,6 @@ discard block |
||
203 | 203 | |
204 | 204 | public function coefficient(string $currency = ''): float |
205 | 205 | { |
206 | - return config('wallet.coefficient.' . $currency , 100.); |
|
206 | + return config('wallet.coefficient.' . $currency, 100.); |
|
207 | 207 | } |
208 | 208 | } |