Total Complexity | 4 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
12 | trait CanExchange |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * @inheritDoc |
||
17 | */ |
||
18 | public function exchange(Wallet $to, int $amount): Transfer |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @inheritDoc |
||
26 | */ |
||
27 | public function safeExchange(Wallet $to, int $amount): ?Transfer |
||
28 | { |
||
29 | try { |
||
30 | return $this->exchange($to, $amount); |
||
31 | } catch (\Throwable $throwable) { |
||
32 | return null; |
||
33 | } |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @inheritDoc |
||
38 | */ |
||
39 | public function forceExchange(Wallet $to, int $amount): Transfer |
||
61 | }); |
||
62 | } |
||
65 |