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
Pull Request — master (#86)
by
unknown
05:33
created

PushSubscription::getTable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace NotificationChannels\WebPush;
4
5
use Illuminate\Support\Facades\Config;
6
use Illuminate\Database\Eloquent\Model;
7
8
class PushSubscription extends Model
9
{
10
    /**
11
     * The attributes that are mass assignable.
12
     *
13
     * @var array
14
     */
15
    protected $fillable = [
16
        'endpoint',
17
        'public_key',
18
        'auth_token',
19
    ];
20
21
    /**
22
     * Get the user that owns the subscription.
23
     *
24
     * @return \Illuminate\Contracts\Auth\Authenticatable
25
     */
26 1
    public function user()
27
    {
28 1
        return $this->belongsTo(Config::get('auth.providers.users.model'));
29
    }
30
31
    /**
32
     * Find a subscription by the given endpint.
33
     *
34
     * @param  string $endpoint
35
     * @return static|null
36
     */
37 8
    public static function findByEndpoint($endpoint)
38
    {
39 8
        return static::where('endpoint', $endpoint)->first();
40
    }
41
42
    /**
43
     * Get the table associated with the model.
44
     *
45
     * @return string
46
     */
47 9
    public function getTable()
48
    {
49 9
        return Config::get('webpush.table_name');
50
    }
51
}
52