| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | 82 | public function getBalance($object): int |
|
| 16 | { |
||
| 17 | 82 | $wallet = app(WalletService::class)->getWallet($object); |
|
| 18 | 82 | $proxy = app(ProxyService::class); |
|
| 19 | 82 | if (!$proxy->has($wallet->getKey())) { |
|
|
|
|||
| 20 | 82 | $proxy->set($wallet->getKey(), (int) $wallet->getOriginal('balance', 0)); |
|
| 21 | } |
||
| 22 | |||
| 23 | 82 | return $proxy[$wallet->getKey()]; |
|
| 24 | } |
||
| 54 |