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