@@ -26,11 +26,11 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function safeExchange(Wallet $to, int $amount): ?Transfer |
| 28 | 28 | { |
| 29 | - try { |
|
| 30 | - return $this->exchange($to, $amount); |
|
| 31 | - } catch (\Throwable $throwable) { |
|
| 32 | - return null; |
|
| 33 | - } |
|
| 29 | + try { |
|
| 30 | + return $this->exchange($to, $amount); |
|
| 31 | + } catch (\Throwable $throwable) { |
|
| 32 | + return null; |
|
| 33 | + } |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | $from = $this; |
| 45 | 45 | |
| 46 | - return DB::transaction(function () use ($from, $to, $amount) { |
|
| 46 | + return DB::transaction(function() use ($from, $to, $amount) { |
|
| 47 | 47 | $rate = app(CurrencyService::class)->rate($from, $to); |
| 48 | 48 | $withdraw = $this->withdraw($amount); |
| 49 | 49 | $deposit = $to->deposit($amount * $rate); |