Passed
Pull Request — master (#5)
by Maksim
05:00
created

TestBinaryRole   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
eloc 11
c 1
b 1
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hex_users() 0 2 1
A users() 0 2 1
1
<?php
2
3
namespace MaksimM\CompositePrimaryKeys\Tests\Stubs;
4
5
use Illuminate\Database\Eloquent\Model;
6
use MaksimM\CompositePrimaryKeys\Http\Traits\HasCompositePrimaryKey;
7
8
class TestBinaryRole extends Model
9
{
10
11
    use HasCompositePrimaryKey;
0 ignored issues
show
Bug introduced by
The trait MaksimM\CompositePrimary...\HasCompositePrimaryKey requires the property $key which is not provided by MaksimM\CompositePrimary...ts\Stubs\TestBinaryRole.
Loading history...
12
13
    protected $table = 'binary_roles';
14
15
    public $timestamps = false;
16
17
    protected $primaryKey = 'role_id';
18
19
    protected $binaryColumns = [
20
        'role_id',
21
    ];
22
23
    protected $fillable = [
24
        'name',
25
    ];
26
27
    public function users(){
28
        return $this->hasMany(TestBinaryUser::class, 'binary_role_id', 'role_id');
29
    }
30
31
    public function hex_users(){
32
        return $this->hasMany(TestBinaryUserHex::class, 'binary_role_id', 'role_id');
33
    }
34
35
}
36