Passed
Push — master ( 653fca...0c85de )
by Maksim
03:56 queued 11s
created

TestBinaryUser   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
eloc 15
c 2
b 1
f 0
dl 0
loc 39
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A role() 0 3 1
A organization() 0 3 1
A hex_binary_role() 0 3 1
A binary_role() 0 3 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 TestBinaryUser extends Model
9
{
10
    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\TestBinaryUser.
Loading history...
11
12
    protected $table = 'binary_users';
13
14
    public $timestamps = false;
15
16
    protected $binaryColumns = [
17
        'user_id',
18
    ];
19
20
    protected $primaryKey = [
21
        'user_id',
22
        'organization_id',
23
    ];
24
25
    protected $fillable = [
26
        'name',
27
    ];
28
29
    public function organization()
30
    {
31
        return $this->belongsTo(TestOrganization::class, 'organization_id', 'organization_id');
32
    }
33
34
    public function role()
35
    {
36
        return $this->belongsTo(TestRole::class, 'role_id', 'role_id');
37
    }
38
39
    public function binary_role()
40
    {
41
        return $this->belongsTo(TestBinaryRole::class, 'binary_role_id', 'role_id');
42
    }
43
44
    public function hex_binary_role()
45
    {
46
        return $this->belongsTo(TestBinaryRoleHex::class, 'binary_role_id', 'role_id');
47
    }
48
}
49