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

Shop::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 8
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent;
6
7
/**
8
 * App\Shop
9
 *
10
 * @property integer $id
11
 * @property string $name
12
 * @property string $address
13
 * @property \Carbon\Carbon $deleted_at
14
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Sale[] $sales
15
 * @method static \Illuminate\Database\Query\Builder|\App\Shop whereId($value)
16
 * @method static \Illuminate\Database\Query\Builder|\App\Shop whereName($value)
17
 * @method static \Illuminate\Database\Query\Builder|\App\Shop whereAddress($value)
18
 * @method static \Illuminate\Database\Query\Builder|\App\Shop whereDeletedAt($value)
19
 * @mixin \Eloquent
20
 */
21 View Code Duplication
class Shop 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...
22
{
23
    use Eloquent\SoftDeletes;
24
25
    /**
26
     * We do not want any timestamps.
27
     *
28
     * @var bool
29
     */
30
    public $timestamps = false;
31
    /**
32
     * @var array
33
     */
34
    protected $dates = ['deleted_at'];
35
    /**
36
     * The attributes that are not mass assignable.
37
     *
38
     * @var array
39
     */
40
    protected $guarded = [];
41
42
    public static function boot()
43
    {
44
        parent::boot();
45
46
        static::deleting(function (Shop $shop) {
47
            $shop->sales()->delete();
48
        });
49
    }
50
51
    /**
52
     * Purchase performed by this shop.
53
     *
54
     * @return Eloquent\Relations\HasMany
55
     */
56
    public function sales()
57
    {
58
        return $this->hasMany(Sale::class);
59
    }
60
}
61