Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 120 | public function getBalance($object) |
|
21 | { |
||
22 | 120 | $wallet = app(WalletService::class)->getWallet($object); |
|
23 | 120 | if (!\array_key_exists($wallet->getKey(), $this->balanceSheets)) { |
|
24 | 120 | $balance = method_exists($wallet, 'getRawOriginal') ? |
|
25 | 120 | $wallet->getRawOriginal('balance', 0) : $wallet->getOriginal('balance', 0); |
|
26 | |||
27 | 120 | $this->balanceSheets[$wallet->getKey()] = $this->toInt($balance); |
|
|
|||
28 | } |
||
29 | |||
30 | 120 | return $this->balanceSheets[$wallet->getKey()]; |
|
31 | } |
||
65 |