User   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 60
ccs 4
cts 8
cp 0.5
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getVideos() 0 4 1
A apiKey() 0 4 1
A getLikes() 0 4 1
A getComments() 0 4 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Foundation\Auth\User as Authenticatable;
6
7
/**
8
 * Class User.
9
 *
10
 * @property int $id
11
 */
12
class User extends Authenticatable
13
{
14
    /**
15
     * The attributes that are mass assignable.
16
     *
17
     * @var array
18
     */
19
    protected $fillable = [
20
        'name', 'email', 'password',
21
    ];
22
23
    /**
24
     * The attributes that should be hidden for arrays.
25
     *
26
     * @var array
27
     */
28
    protected $hidden = [
29
        'password', 'remember_token',
30
    ];
31
32
    /**
33
     * Get videos.
34
     *
35
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
36
     */
37 19
    public function getVideos()
38
    {
39 19
        return $this->hasMany(\App\Video::class);
40
    }
41
42
    /**
43
     * Get ApiKey.
44
     *
45
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
46
     */
47 28
    public function apiKey()
48
    {
49 28
        return $this->hasOne('Chrisbjr\ApiGuard\Models\ApiKey');
50
    }
51
52
    /**
53
     * Get likes.
54
     *
55
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
56
     */
57
    public function getLikes()
58
    {
59
        return $this->hasMany(\App\LikeDislike::class);
60
    }
61
62
    /**
63
     * Get comments.
64
     *
65
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
66
     */
67
    public function getComments()
68
    {
69
        return $this->hasMany(\App\Comment::class);
70
    }
71
}
72