Passed
Push — master ( f218e6...f51c1b )
by Arthur
04:59
created

User   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 32
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ownedBy() 0 3 1
A ownerId() 0 3 1
1
<?php
2
3
namespace Modules\User\Entities;
4
5
use Foundation\Abstracts\SqlModel;
6
use Foundation\Contracts\Ownable;
7
use Foundation\Traits\Cacheable;
8
use Illuminate\Auth\Authenticatable;
9
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
10
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
11
use Illuminate\Foundation\Auth\Access\Authorizable;
12
use Illuminate\Notifications\HasDatabaseNotifications;
13
use Illuminate\Notifications\Notifiable;
14
use Modules\Notification\Traits\ReceivesWebNotifications;
15
use Spatie\Permission\Traits\HasRoles;
16
17
/**
18
 * Class User.
19
 *
20
 * @property string $_id
21
 * @property string $id
22
 * @property string $username
23
 * @property string $email
24
 * @property string $name
25
 * @property string $avatar
26
 * @property string $provider
27
 */
28
class User extends SqlModel implements AuthorizableContract, AuthenticatableContract, Ownable
29
{
30
    use Notifiable,
0 ignored issues
show
introduced by
The trait Spatie\Permission\Traits\HasRoles requires some properties which are not provided by Modules\User\Entities\User: $map, $permissions, $roles
Loading history...
Bug introduced by
The trait Illuminate\Auth\Authenticatable requires the property $password which is not provided by Modules\User\Entities\User.
Loading history...
Bug introduced by
The trait Illuminate\Notifications\Notifiable requires the property $phone_number which is not provided by Modules\User\Entities\User.
Loading history...
31
        Authorizable,
32
        Authenticatable,
33
        Cacheable,
34
        HasRoles,
35
        ReceivesWebNotifications;
36
37
    protected $guard_name = 'api';
38
39
    /**
40
     * @var string
41
     */
42
    protected $table = 'users';
43
44 2
    /**
45
     * @var array
46 2
     */
47
    protected $guarded = [];
48
49 2
    /**
50
     * @return mixed
51 2
     */
52
    public function ownerId()
53
    {
54 2
        return $this->id;
55
    }
56 2
57
    public function ownedBy()
58
    {
59
        return self::class;
60
    }
61
}
62