@@ -68,7 +68,7 @@ class LogLogin implements EntityInterface
68
68
'LogLogin ' ,
69
69
'LogLogin.id ' ,
70
70
])]
71
- private UuidInterface $ id ;
71
+ private readonly UuidInterface $ id ;
72
72
73
73
#[ORM \Column(
74
74
name: 'username ' ,
@@ -80,7 +80,7 @@ class LogLogin implements EntityInterface
80
80
'LogLogin ' ,
81
81
'LogLogin.username ' ,
82
82
])]
83
- private string $ username = '' ;
83
+ private readonly string $ username ;
84
84
85
85
#[ORM \Column(
86
86
name: 'client_type ' ,
@@ -92,7 +92,7 @@ class LogLogin implements EntityInterface
92
92
'LogLogin ' ,
93
93
'LogLogin.clientType ' ,
94
94
])]
95
- private ? string $ clientType = null ;
95
+ private readonly string $ clientType ;
96
96
97
97
#[ORM \Column(
98
98
name: 'client_name ' ,
@@ -104,7 +104,7 @@ class LogLogin implements EntityInterface
104
104
'LogLogin ' ,
105
105
'LogLogin.clientName ' ,
106
106
])]
107
- private ? string $ clientName = null ;
107
+ private readonly string $ clientName ;
108
108
109
109
#[ORM \Column(
110
110
name: 'client_short_name ' ,
@@ -116,7 +116,7 @@ class LogLogin implements EntityInterface
116
116
'LogLogin ' ,
117
117
'LogLogin.clientShortName ' ,
118
118
])]
119
- private ? string $ clientShortName = null ;
119
+ private readonly string $ clientShortName ;
120
120
121
121
#[ORM \Column(
122
122
name: 'client_version ' ,
@@ -128,7 +128,7 @@ class LogLogin implements EntityInterface
128
128
'LogLogin ' ,
129
129
'LogLogin.clientVersion ' ,
130
130
])]
131
- private ? string $ clientVersion = null ;
131
+ private readonly string $ clientVersion ;
132
132
133
133
#[ORM \Column(
134
134
name: 'client_engine ' ,
@@ -140,7 +140,7 @@ class LogLogin implements EntityInterface
140
140
'LogLogin ' ,
141
141
'LogLogin.clientEngine ' ,
142
142
])]
143
- private ? string $ clientEngine = null ;
143
+ private readonly string $ clientEngine ;
144
144
145
145
#[ORM \Column(
146
146
name: 'os_name ' ,
@@ -152,7 +152,7 @@ class LogLogin implements EntityInterface
152
152
'LogLogin ' ,
153
153
'LogLogin.osName ' ,
154
154
])]
155
- private ? string $ osName = null ;
155
+ private readonly string $ osName ;
156
156
157
157
#[ORM \Column(
158
158
name: 'os_short_name ' ,
@@ -164,7 +164,7 @@ class LogLogin implements EntityInterface
164
164
'LogLogin ' ,
165
165
'LogLogin.osShortName ' ,
166
166
])]
167
- private ? string $ osShortName = null ;
167
+ private readonly string $ osShortName ;
168
168
169
169
#[ORM \Column(
170
170
name: 'os_version ' ,
@@ -176,7 +176,7 @@ class LogLogin implements EntityInterface
176
176
'LogLogin ' ,
177
177
'LogLogin.osVersion ' ,
178
178
])]
179
- private ? string $ osVersion = null ;
179
+ private readonly string $ osVersion ;
180
180
181
181
#[ORM \Column(
182
182
name: 'os_platform ' ,
@@ -188,7 +188,7 @@ class LogLogin implements EntityInterface
188
188
'LogLogin ' ,
189
189
'LogLogin.osPlatform ' ,
190
190
])]
191
- private ? string $ osPlatform = null ;
191
+ private readonly string $ osPlatform ;
192
192
193
193
#[ORM \Column(
194
194
name: 'device_name ' ,
@@ -200,7 +200,7 @@ class LogLogin implements EntityInterface
200
200
'LogLogin ' ,
201
201
'LogLogin.deviceName ' ,
202
202
])]
203
- private ? string $ deviceName = null ;
203
+ private readonly string $ deviceName ;
204
204
205
205
#[ORM \Column(
206
206
name: 'brand_name ' ,
@@ -212,7 +212,7 @@ class LogLogin implements EntityInterface
212
212
'LogLogin ' ,
213
213
'LogLogin.brandName ' ,
214
214
])]
215
- private ? string $ brandName = null ;
215
+ private readonly string $ brandName ;
216
216
217
217
#[ORM \Column(
218
218
name: 'model ' ,
@@ -224,9 +224,7 @@ class LogLogin implements EntityInterface
224
224
'LogLogin ' ,
225
225
'LogLogin.model ' ,
226
226
])]
227
- private ?string $ model = null ;
228
-
229
- private DeviceDetector $ deviceDetector ;
227
+ private readonly string $ model ;
230
228
231
229
/**
232
230
* LogLogin constructor.
@@ -242,9 +240,9 @@ public function __construct(
242
240
'LogLogin ' ,
243
241
'LogLogin.type ' ,
244
242
])]
245
- private string $ type ,
246
- Request $ request ,
247
- DeviceDetector $ deviceDetector ,
243
+ private readonly string $ type ,
244
+ private Request $ request ,
245
+ private readonly DeviceDetector $ deviceDetector ,
248
246
#[ORM \ManyToOne(
249
247
targetEntity: User::class,
250
248
inversedBy: 'logsLogin ' ,
@@ -257,19 +255,15 @@ public function __construct(
257
255
'LogLogin ' ,
258
256
'LogLogin.user ' ,
259
257
])]
260
- private ?User $ user = null
258
+ private readonly ?User $ user = null
261
259
) {
262
260
$ this ->id = $ this ->createUuid ();
263
261
264
- $ this ->deviceDetector = $ deviceDetector ;
265
-
266
262
$ this ->processTimeAndDate ();
267
263
$ this ->processRequestData ($ request );
268
264
$ this ->processClientData ();
269
265
270
- if ($ this ->user !== null ) {
271
- $ this ->username = $ this ->user ->getUsername ();
272
- }
266
+ $ this ->username = $ this ->user ?->getUsername() ?? '' ;
273
267
}
274
268
275
269
public function getId (): string
0 commit comments