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 | 84 | public function getBalance($object): int |
|
16 | { |
||
17 | 84 | $wallet = app(WalletService::class)->getWallet($object); |
|
18 | 84 | $proxy = app(ProxyService::class); |
|
19 | 84 | if (!$proxy->has($wallet->getKey())) { |
|
|
|||
20 | 84 | $proxy->set($wallet->getKey(), (int) $wallet->getOriginal('balance', 0)); |
|
21 | } |
||
22 | |||
23 | 84 | return $proxy[$wallet->getKey()]; |
|
24 | } |
||
54 |