Video::comments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace LearnParty;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Video extends Model
8
{
9
    protected $fillable  =[
10
        'title',
11
        'url',
12
        'description',
13
        'user_id',
14
    ];
15
16
    /**
17
     * A video belongs to one user.
18
     *
19
     * @return Object
20
     */
21
    public function user()
22
    {
23
        return $this->belongsTo('LearnParty\User');
24
    }
25
26
    /**
27
     * Get a list of categories associated with
28
     * this video
29
     *
30
     * @param  [type] $value [description]
0 ignored issues
show
Documentation introduced by
The doc-type [type] could not be parsed: Unknown type name "" at position 0. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
Bug introduced by
There is no parameter named $value. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
31
     * @return array        Associated categories
32
     */
33
    public function getCategoryListAttribute()
34
    {
35
        return $this->categories()->lists('id')->toArray();
36
    }
37
38
    /**
39
     * A video belongs to many categories
40
     *
41
     * @return Object.
0 ignored issues
show
Documentation introduced by
The doc-type Object. could not be parsed: Unknown type name "Object." at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
42
     */
43
    public function categories()
44
    {
45
        return $this->belongsToMany('LearnParty\Category')->withTimestamps();
46
    }
47
48
    /**
49
     * A video can have many comments.
50
     *
51
     * @return Object
52
     */
53
    public function comments()
54
    {
55
        return $this->hasMany('LearnParty\Comment');
56
    }
57
58
    /**
59
     * A video can have many favorites
60
     *
61
     * @return Object
62
     */
63
    public function favorites()
64
    {
65
        return $this->hasMany('LearnParty\Favorite');
66
    }
67
}
68