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

Make::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
crap 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent;
6
7
/**
8
 * App\Make
9
 *
10
 * @property integer $id
11
 * @property string $name
12
 * @property \Carbon\Carbon $deleted_at
13
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Model[] $models
14
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Rack[] $racks
15
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Purchase[] $purchases
16
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Guitar[] $guitars
17
 * @method static \Illuminate\Database\Query\Builder|\App\Make whereId($value)
18
 * @method static \Illuminate\Database\Query\Builder|\App\Make whereName($value)
19
 * @method static \Illuminate\Database\Query\Builder|\App\Make whereDeletedAt($value)
20
 * @mixin \Eloquent
21
 */
22
class Make extends Eloquent\Model
23
{
24
    use Eloquent\SoftDeletes;
25
26
    /**
27
     * We do not want any timestamps.
28
     *
29
     * @var bool
30
     */
31
    public $timestamps = false;
32
    /**
33
     * @var array
34
     */
35
    protected $dates = ['deleted_at'];
36
    /**
37
     * The attributes that are not mass assignable.
38
     *
39
     * @var array
40
     */
41
    protected $guarded = [];
42
43 23
    public static function boot()
44
    {
45 23
        parent::boot();
46
47 23
        static::deleting(function (Make $make) {
48
            $make->models()->delete();
49
            $make->racks()->delete();
50
            $make->purchases()->delete();
51
            $make->guitars()->delete();
52 23
        });
53 23
    }
54
55
    /**
56
     * Models of this make.
57
     *
58
     * @return Eloquent\Relations\HasMany
59
     */
60
    public function models()
61
    {
62
        return $this->hasMany(Model::class);
63
    }
64
65
    /**
66
     * Rack this make is located in.
67
     *
68
     * @return Eloquent\Relations\HasMany
69
     */
70
    public function racks()
71
    {
72
        return $this->hasMany(Rack::class);
73
    }
74
75
    /**
76
     * Purchases of this make.
77
     *
78
     * @return Eloquent\Relations\HasMany
79
     */
80
    public function purchases()
81
    {
82
        return $this->hasMany(Purchase::class);
83
    }
84
85
    /**
86
     * Guitars of this make.
87
     *
88
     * @return Eloquent\Relations\HasMany
89
     */
90
    public function guitars()
91
    {
92
        return $this->hasMany(Guitar::class);
93
    }
94
}
95