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.

Position::id()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
namespace BristolSU\ControlDB\Models;
5
6
7
use BristolSU\ControlDB\Traits\PositionTrait;
8
use Illuminate\Database\Eloquent\Model;
9
use Illuminate\Database\Eloquent\SoftDeletes;
10
11
/**
12
 * Represents a position
13
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
14
class Position extends Model implements \BristolSU\ControlDB\Contracts\Models\Position
15
{
16
    use SoftDeletes, PositionTrait {
17
        setDataProviderId as baseSetDataProviderId;
18
    }
19
20
    /**
21
     * Table to use
22
     *
23
     * @var string
24
     */
25
    protected $table = 'control_positions';
26
27
    /**
28
     * Fillable attributes
29
     *
30
     * @var array
31
     */
32
    protected $fillable = ['data_provider_id'];
33
34
    /**
35
     * Attributes to append when casting to an array
36
     *
37
     * @var array
38
     */
39
    protected $appends = [
40
        'data'
41
    ];
42
43
    /**
44
     * ID of the position
45
     *
46
     * @return int
47
     */
48 48
    public function id(): int
49
    {
50 48
        return $this->id;
51
    }
52
53
    /**
54
     * ID of the data provider for the position
55
     *
56
     * @return int
57
     */
58 17
    public function dataProviderId(): int
59
    {
60 17
        return $this->data_provider_id;
61
    }
62
63
    /**
64
     * Laravel integration for a data property
65
     *
66
     * @return \BristolSU\ControlDB\Contracts\Models\DataPosition
67
     */
68 9
    public function getDataAttribute(): \BristolSU\ControlDB\Contracts\Models\DataPosition
69
    {
70 9
        return $this->data();
71
    }
72
73
    /**
74
     * Set the ID of the data provider
75
     *
76
     * @param int $dataProviderId
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
77
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
78 2
    public function setDataProviderId(int $dataProviderId): void
79
    {
80 2
        $this->baseSetDataProviderId($dataProviderId);
81 2
        $this->refresh();
82 2
    }
83
84
85
}
86