Passed
Push — master ( 9c0f53...d83811 )
by Moecasts
04:20
created
src/Models/Wallet.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
     protected function change(string $type, int $amount, ?array $meta, bool $confirmed): Transaction
70 70
     {
71
-        return DB::transaction(function () use ($type, $amount, $meta, $confirmed) {
71
+        return DB::transaction(function() use ($type, $amount, $meta, $confirmed) {
72 72
             if ($confirmed) {
73 73
                 $this->addBalance($amount);
74 74
             }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     {
105 105
         $this->exists or $this->save();
106 106
 
107
-        if (! WalletProxy::has($this->getKey())) {
107
+        if (!WalletProxy::has($this->getKey())) {
108 108
             $balance = $this->attributes['balance'] / $this->coefficient($this->attributes['currency']);
109 109
             WalletProxy::set($this->getKey(), (float) ($balance ?? 0));
110 110
         }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $wallet = $transferable->getReceiptWallet($this->currency);
127 127
 
128
-        return DB::transaction(function () use ($transferable, $amount, $wallet, $meta, $action) {
128
+        return DB::transaction(function() use ($transferable, $amount, $wallet, $meta, $action) {
129 129
             $fee = Tax::fee($transferable, $wallet, $amount);
130 130
             $withdraw = $this->withdraw($amount + $fee, $meta);
131 131
             $deposit = $wallet->deposit($amount, $meta);
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
     public function withdraw(float $amount, ?array $meta = null, bool $confirmed = true): Transaction
137 137
     {
138
-        if (! $this->canWithdraw($amount)) {
138
+        if (!$this->canWithdraw($amount)) {
139 139
             throw new InsufficientFunds(trans('wallet::errors.insufficient_funds'));
140 140
         }
141 141
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     {
178 178
         $wallet = $transferable->getReceiptWallet($this->currency);
179 179
 
180
-        return DB::transaction(function () use ($transferable, $amount, $wallet, $meta, $action) {
180
+        return DB::transaction(function() use ($transferable, $amount, $wallet, $meta, $action) {
181 181
             $fee = Tax::fee($transferable, $wallet, $amount);
182 182
             $withdraw = $this->forceWithdraw($amount + $fee, $meta);
183 183
             $deposit = $wallet->deposit($amount, $meta);
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
 
192 192
         $exchangeRate = config('wallet.exchange.' . $this->currency . '.' . $currency);
193 193
 
194
-        if (! $exchangeRate ||
195
-            ! $this->holder instanceof Exchangeable) {
194
+        if (!$exchangeRate ||
195
+            !$this->holder instanceof Exchangeable) {
196 196
             throw new ExchangeInvalid(trans('wallet::errors.exchange_unsupported'));
197 197
         }
198 198
 
199 199
         $exchangedAmount = $amount * $exchangeRate;
200 200
 
201
-        return DB::transaction(function () use ($wallet, $amount, $exchangedAmount, $meta, $action) {
201
+        return DB::transaction(function() use ($wallet, $amount, $exchangedAmount, $meta, $action) {
202 202
             $fee = Tax::fee($this->holder, $wallet, $amount);
203 203
             $withdraw = $this->withdraw($amount + $fee, $meta);
204 204
             $deposit = $wallet->deposit($exchangedAmount, $meta);
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
 
222 222
         $exchangeRate = config('wallet.exchange.' . $this->currency . '.' . $currency);
223 223
 
224
-        if (! $exchangeRate ||
225
-            ! $this->holder instanceof Exchangeable) {
224
+        if (!$exchangeRate ||
225
+            !$this->holder instanceof Exchangeable) {
226 226
             throw new ExchangeInvalid(trans('wallet::errors.exchange_unsupported'));
227 227
         }
228 228
 
229 229
         $exchangedAmount = $amount * $exchangeRate;
230 230
 
231
-        return DB::transaction(function () use ($wallet, $amount, $exchangedAmount, $meta, $action) {
231
+        return DB::transaction(function() use ($wallet, $amount, $exchangedAmount, $meta, $action) {
232 232
             $fee = Tax::fee($this->holder, $wallet, $amount);
233 233
             $withdraw = $this->forceWithdraw($amount + $fee, $meta);
234 234
             $deposit = $wallet->deposit($exchangedAmount, $meta);
@@ -257,6 +257,6 @@  discard block
 block discarded – undo
257 257
 
258 258
     public function coefficient(string $currency = ''): float
259 259
     {
260
-        return config('wallet.coefficient.' . $currency , 100.);
260
+        return config('wallet.coefficient.' . $currency, 100.);
261 261
     }
262 262
 }
Please login to merge, or discard this patch.