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.

Relatable::source()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\Relatable;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\MorphTo;
7
8
/**
9
 * @property int $id
10
 * @property int $source_id
11
 * @property string $source_type
12
 * @property int $related_id
13
 * @property string $related_type
14
 */
15
class Relatable extends Model
16
{
17
    /** @var array */
18
    protected $guarded = [];
19
20
    /** @var string|null */
21
    protected $primaryKey = null;
22
23
    /** @var bool */
24
    public $incrementing = false;
25
26
    /** @var bool */
27
    public $timestamps = false;
28
29
    public function related() : MorphTo
30
    {
31
        return $this->morphTo('related');
32
    }
33
34
    public function source() : MorphTo
35
    {
36
        return $this->morphTo('source');
37
    }
38
39
    public function getTable() : string
40
    {
41
        return config('laravel-relatable.table', 'relatables');
42
    }
43
44
    public function getRelatedValues() : array
45
    {
46
        return [
47
            'type' => $this->related_type,
48
            'id' => $this->related_id,
49
        ];
50
    }
51
}
52