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

Wallet   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 22
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTable() 0 7 2
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