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.

MailmanMessageModel::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Qodeboy\Mailman\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class MailMessageModel.
9
 */
10
class MailmanMessageModel extends Model
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    protected $table;
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    protected $fillable = [
21
        'message_id',
22
        'content_type',
23
        'status',
24
        'from',
25
        'to',
26
        'reply_to',
27
        'cc',
28
        'bcc',
29
        'subject',
30
        'body',
31
        'instance',
32
    ];
33
34
    /**
35
     * The attributes that should be cast to native types.
36
     *
37
     * @var array
38
     */
39
    protected $casts = [
40
        'from'     => 'json',
41
        'to'       => 'json',
42
        'reply_to' => 'json',
43
        'cc'       => 'json',
44
        'bcc'      => 'json',
45
    ];
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function __construct(array $attributes = [])
51
    {
52
        $this->table = config('mailman.storage.database.table');
53
        parent::__construct($attributes);
54
    }
55
56
    /**
57
     * Set instance attribute.
58
     *
59
     * @param $value
60
     */
61
    public function setInstanceAttribute($value)
62
    {
63
        $this->attributes['instance'] = serialize($value);
64
    }
65
66
    /**
67
     * Get instance attribute.
68
     *
69
     * @param $value
70
     *
71
     * @return mixed
72
     */
73
    public function getInstanceAttribute($value)
74
    {
75
        return unserialize($value);
76
    }
77
}
78