Passed
Pull Request — master (#53)
by Damien
02:38
created

AuditEntry::getUserFqdn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DH\DoctrineAuditBundle\Reader;
4
5
class AuditEntry
6
{
7
    /**
8
     * @var int
9
     */
10
    protected $id;
11
12
    /**
13
     * @var string
14
     */
15
    protected $type;
16
17
    /**
18
     * @var string
19
     */
20
    protected $object_id;
21
22
    /**
23
     * @var string
24
     */
25
    protected $diffs;
26
27
    /**
28
     * @var int
29
     */
30
    protected $blame_id;
31
32
    /**
33
     * @var string
34
     */
35
    protected $blame_user;
36
37
    /**
38
     * @var string
39
     */
40
    protected $blame_user_fqdn;
41
42
    /**
43
     * @var string
44
     */
45
    protected $blame_user_firewall;
46
47
    /**
48
     * @var string
49
     */
50
    protected $ip;
51
52
    /**
53
     * @var string
54
     */
55
    protected $created_at;
56
57
    public function __set($name, $value)
58
    {
59
        $this->{$name} = $value;
60
    }
61
62
    /**
63
     * Get the value of id.
64
     *
65
     * @return int
66
     */
67
    public function getId(): int
68
    {
69
        return $this->id;
70
    }
71
72
    /**
73
     * Get the value of type.
74
     *
75
     * @return string
76
     */
77
    public function getType(): string
78
    {
79
        return $this->type;
80
    }
81
82
    /**
83
     * Get the value of object_id.
84
     *
85
     * @return string
86
     */
87
    public function getObjectId(): string
88
    {
89
        return $this->object_id;
90
    }
91
92
    /**
93
     * Get the value of blame_id.
94
     *
95
     * @return int|string
96
     */
97
    public function getUserId()
98
    {
99
        return $this->blame_id ?? 'Unknown';
100
    }
101
102
    /**
103
     * Get the value of blame_user.
104
     *
105
     * @return string
106
     */
107
    public function getUsername(): string
108
    {
109
        return $this->blame_user ?? 'Unknown';
110
    }
111
112
    /**
113
     * @return null|string
114
     */
115
    public function getUserFqdn(): ?string
116
    {
117
        return $this->blame_user_fqdn;
118
    }
119
120
    /**
121
     * @return null|string
122
     */
123
    public function getUserFirewall(): ?string
124
    {
125
        return $this->blame_user_firewall;
126
    }
127
128
    /**
129
     * Get the value of ip.
130
     *
131
     * @return string
132
     */
133
    public function getIp(): ?string
134
    {
135
        return $this->ip;
136
    }
137
138
    /**
139
     * Get the value of created_at.
140
     *
141
     * @return string
142
     */
143
    public function getCreatedAt(): string
144
    {
145
        return $this->created_at;
146
    }
147
148
    /**
149
     * Get the value of created_at.
150
     *
151
     * @return array
152
     */
153
    public function getDiffs(): ?array
154
    {
155
        return json_decode($this->diffs, true);
156
    }
157
}
158