Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 65 | public function wallet(): MorphOne |
|
23 | { |
||
24 | 65 | return ($this instanceof WalletModel ? $this->holder : $this) |
|
25 | 65 | ->morphOne(config('wallet.wallet.model'), 'holder') |
|
|
|||
26 | 65 | ->where('slug', config('wallet.wallet.default.slug')) |
|
27 | 65 | ->withDefault([ |
|
28 | 65 | 'name' => config('wallet.wallet.default.name'), |
|
29 | 65 | 'slug' => config('wallet.wallet.default.slug'), |
|
30 | 65 | 'balance' => 0, |
|
31 | ]); |
||
35 |