Passed
Push — master ( 7bc374...cf39f3 )
by Arthur
05:05
created

Machine   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 17
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
1
<?php
2
3
namespace Modules\Machine\Entities;
4
5
use Foundation\Abstracts\MongoModel;
6
use Foundation\Contracts\Ownable;
7
use Foundation\Traits\Notifiable;
8
use Foundation\Traits\OwnedByUser;
9
use Modules\User\Entities\User;
10
11
/**
12
 * Class User.
13
 *
14
 * @property string $_id
15
 * @property string $id
16
 * @property string $username
17
 * @property string $email
18
 * @property string $name
19
 * @property string $avatar
20
 * @property string $provider
21
 */
22
class Machine extends MongoModel implements Ownable
23
{
24
    use Notifiable, OwnedByUser;
0 ignored issues
show
Bug introduced by
The trait Foundation\Traits\Notifiable requires the property $phone_number which is not provided by Modules\Machine\Entities\Machine.
Loading history...
25
26
    /**
27
     * @var string
28
     */
29
    protected $collection = 'machines';
30
31
    /**
32
     * @var array
33
     */
34
    protected $guarded = [];
35
36 1
    public function user()
37
    {
38 1
        return $this->belongsTo(User::class, 'identity_id', 'user_id');
39
    }
40
}
41