Completed
Pull Request — master (#14)
by Бабичев
02:30
created

Wallet::getTable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Bavix\Wallet\Models;
4
5
use Bavix\Wallet\Interfaces\WalletFloat;
6
use Bavix\Wallet\Traits\HasWalletFloat;
7
use Illuminate\Database\Eloquent\Model;
8
use Bavix\Wallet\Interfaces\Wallet as WalletInterface;
9
10
class Wallet extends Model implements WalletInterface, WalletFloat
11
{
12
13
    use HasWalletFloat;
0 ignored issues
show
Bug introduced by
The trait Bavix\Wallet\Traits\HasWalletFloat requires the property $total which is not provided by Bavix\Wallet\Models\Wallet.
Loading history...
14
15
    /**
16
     * @var array
17
     */
18
    protected $fillable = [
19
        'balance' => 'int',
20
    ];
21
22
    /**
23
     * @return string
24
     */
25 21
    public function getTable(): string
26
    {
27 21
        if (!$this->table) {
28 21
            $this->table = \config('wallet.wallet.table');
29
        }
30
31 21
        return parent::getTable();
32
    }
33
34
}
35