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.

Notification::notifiable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent;
6
7
/**
8
 * App\Notification.
9
 *
10
 * @property int $id
11
 * @property string $icon
12
 * @property string $link
13
 * @property string $message
14
 * @property string $notifiable_type
15
 * @property int $notifiable_id
16
 * @property bool $dismissed
17
 * @property \Carbon\Carbon $created_at
18
 * @property \Carbon\Carbon $updated_at
19
 * @property \Carbon\Carbon $deleted_at
20
 * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $notifiable
21
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereId($value)
22
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereIcon($value)
23
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereLink($value)
24
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereMessage($value)
25
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereNotifiableType($value)
26
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereNotifiableId($value)
27
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereDismissed($value)
28
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereCreatedAt($value)
29
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereUpdatedAt($value)
30
 * @method static \Illuminate\Database\Query\Builder|\App\Notification whereDeletedAt($value)
31
 * @method static \Illuminate\Database\Query\Builder|\App\Notification pending()
32
 * @method static \Illuminate\Database\Query\Builder|\App\Notification dismissed()
33
 * @mixin \Eloquent
34
 */
35
class Notification extends Eloquent\Model
36
{
37
    use Eloquent\SoftDeletes;
38
39
    /**
40
     * @var array
41
     */
42
    protected $dates = ['deleted_at'];
43
44
    /**
45
     * The attributes that are not mass assignable.
46
     *
47
     * @var array
48
     */
49
    protected $guarded = [];
50
51
    /**
52
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
53
     */
54
    public function notifiable()
55
    {
56
        return $this->morphTo();
57
    }
58
59
    /**
60
     * @param $query
61
     *
62
     * @return Eloquent\Builder
63
     */
64
    public function scopePending($query)
65
    {
66
        return $query->whereDismissed(false);
67
    }
68
69
    /**
70
     * @param $query
71
     *
72
     * @return Eloquent\Builder
73
     */
74
    public function scopeDismissed($query)
75
    {
76
        return $query->whereDismissed(true);
77
    }
78
79
    /**
80
     * Dismiss the notification.
81
     * @return bool|int
82
     */
83
    public function dismiss()
84
    {
85
        return $this->update(['dismissed' => true]);
86
    }
87
}
88