GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( ea9462...f6a83c )
by Nikhil
10:26
created

Model::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 8
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent;
6
7
/**
8
 * App\Model
9
 *
10
 * @property integer $id
11
 * @property integer $make_id
12
 * @property string $name
13
 * @property string $photo
14
 * @property \Carbon\Carbon $deleted_at
15
 * @property-read \App\Make $make
16
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Guitar[] $guitars
17
 * @method static \Illuminate\Database\Query\Builder|\App\Model whereId($value)
18
 * @method static \Illuminate\Database\Query\Builder|\App\Model whereMakeId($value)
19
 * @method static \Illuminate\Database\Query\Builder|\App\Model whereName($value)
20
 * @method static \Illuminate\Database\Query\Builder|\App\Model wherePhoto($value)
21
 * @method static \Illuminate\Database\Query\Builder|\App\Model whereDeletedAt($value)
22
 * @mixin \Eloquent
23
 */
24 View Code Duplication
class Model extends Eloquent\Model
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
{
26
    use Eloquent\SoftDeletes;
27
28
    /**
29
     * We do not want any timestamps.
30
     *
31
     * @var bool
32
     */
33
    public $timestamps = false;
34
    /**
35
     * @var array
36
     */
37
    protected $dates = ['deleted_at'];
38
    /**
39
     * The attributes that are not mass assignable.
40
     *
41
     * @var array
42
     */
43
    protected $guarded = [];
44
45 4
    public static function boot()
46
    {
47 4
        parent::boot();
48
49 4
        static::deleting(function (Model $model) {
50
            $model->guitars()->delete();
51 4
        });
52 4
    }
53
54
    /**
55
     * Make of this model.
56
     *
57
     * @return Eloquent\Relations\BelongsTo
58
     */
59
    public function make()
60
    {
61
        return $this->belongsTo(Make::class);
62
    }
63
64
    /**
65
     * Guitars of this model.
66
     *
67
     * @return Eloquent\Relations\HasMany
68
     */
69
    public function guitars()
70
    {
71
        return $this->hasMany(Guitar::class);
72
    }
73
}
74