@@ -41,77 +41,63 @@ class General
41
41
*
42
42
* @var array
43
43
*/
44
- protected static $ personaStateMapping
45
- = [
46
- self ::PERSONA_STATE_OFFLINE => 'offline ' ,
47
- self ::PERSONA_STATE_ONLINE => 'online ' ,
48
- self ::PERSONA_STATE_BUSY => 'busy ' ,
49
- self ::PERSONA_STATE_AWAY => 'away ' ,
50
- self ::PERSONA_STATE_SNOOZE => 'snooze ' ,
51
- self ::PERSONA_STATE_LOOKING_TO_TRADE => 'looking to trade ' ,
52
- self ::PERSONA_STATE_LOOKING_TO_PLAY => 'looking to play ' ,
53
- ];
44
+ protected const PERSONA_STATE_MAPPING = [
45
+ self ::PERSONA_STATE_OFFLINE => 'offline ' ,
46
+ self ::PERSONA_STATE_ONLINE => 'online ' ,
47
+ self ::PERSONA_STATE_BUSY => 'busy ' ,
48
+ self ::PERSONA_STATE_AWAY => 'away ' ,
49
+ self ::PERSONA_STATE_SNOOZE => 'snooze ' ,
50
+ self ::PERSONA_STATE_LOOKING_TO_TRADE => 'looking to trade ' ,
51
+ self ::PERSONA_STATE_LOOKING_TO_PLAY => 'looking to play ' ,
52
+ ];
54
53
55
54
/**
56
55
* Mapping of community visibility state integer values to strings.
57
56
*
58
57
* @var array
59
58
*/
60
- protected static $ communityVisibilityStateMapping
61
- = [
62
- self ::COMMUNITY_VISIBILITY_STATE_PRIVATE => 'private ' ,
63
- self ::COMMUNITY_VISIBILITY_STATE_PUBLIC => 'public ' ,
64
- ];
59
+ protected const COMMUNITY_VISIBILITY_STATE_MAPPING = [
60
+ self ::COMMUNITY_VISIBILITY_STATE_PRIVATE => 'private ' ,
61
+ self ::COMMUNITY_VISIBILITY_STATE_PUBLIC => 'public ' ,
62
+ ];
65
63
66
64
/**
67
65
* 64bit SteamID of the user.
68
66
*
69
67
* This is of type string to be compatible with 32-bit systems
70
- *
71
- * @var string
72
68
*/
73
- protected $ steamId = '' ;
69
+ protected string $ steamId = '' ;
74
70
75
71
/**
76
72
* User's display name.
77
- *
78
- * @var string
79
73
*/
80
- protected $ displayName = '' ;
74
+ protected string $ displayName = '' ;
81
75
82
76
/**
83
77
* Full URL of the user's Steam community profile.
84
- *
85
- * @var string
86
78
*/
87
- protected $ profileUrl = '' ;
79
+ protected string $ profileUrl = '' ;
88
80
89
81
/**
90
82
* Full URL of the user's 32x32px avatar.
91
83
*
92
84
* If the user hasn't configured an avatar, this will be the default ? avatar.
93
- *
94
- * @var string
95
85
*/
96
- protected $ avatar = '' ;
86
+ protected string $ avatar = '' ;
97
87
98
88
/**
99
89
* Full URL of the user's 64x64px avatar.
100
90
*
101
91
* If the user hasn't configured an avatar, this will be the default ? avatar.
102
- *
103
- * @var string
104
92
*/
105
- protected $ avatarMedium = '' ;
93
+ protected string $ avatarMedium = '' ;
106
94
107
95
/**
108
96
* Full URL of the user's 184x184px avatar.
109
97
*
110
98
* If the user hasn't configured an avatar, this will be the default ? avatar.
111
- *
112
- * @var string
113
99
*/
114
- protected $ avatarFull = '' ;
100
+ protected string $ avatarFull = '' ;
115
101
116
102
/**
117
103
* User's current status.
@@ -125,10 +111,8 @@ class General
125
111
* 6 - looking to play
126
112
*
127
113
* If the user's profile is private, this will always be "0".
128
- *
129
- * @var int
130
114
*/
131
- protected $ personaState = 0 ;
115
+ protected int $ personaState = 0 ;
132
116
133
117
/**
134
118
* This represents whether the profile is visible or not.
@@ -138,31 +122,23 @@ class General
138
122
*
139
123
* 1 - profile is not visible (Private, Friends Only, etc.)
140
124
* 3 - profile is "Public"
141
- *
142
- * @var int
143
125
*/
144
- protected $ communityVisibilityState = 0 ;
126
+ protected int $ communityVisibilityState = 0 ;
145
127
146
128
/**
147
129
* Indicates if the user has a community profile configured.
148
- *
149
- * @var bool
150
130
*/
151
- protected $ profileState = false ;
131
+ protected bool $ profileState = false ;
152
132
153
133
/**
154
134
* Last time the user was online as \DateTime object.
155
- *
156
- * @var null|\DateTime
157
135
*/
158
- protected $ lastLogoff ;
136
+ protected ? \ DateTime $ lastLogoff ;
159
137
160
138
/**
161
139
* Indicates if the profile allows public comments.
162
- *
163
- * @var bool
164
140
*/
165
- protected $ commentPermission = false ;
141
+ protected bool $ commentPermission = false ;
166
142
167
143
/**
168
144
* Sets the 64bit SteamID of the user.
@@ -314,11 +290,11 @@ public function getPersonaState(): int
314
290
public function getPersonaStateString (): string
315
291
{
316
292
$ key = $ this ->getPersonaState ();
317
- if (!array_key_exists ($ key , self ::$ personaStateMapping )) {
293
+ if (!array_key_exists ($ key , self ::PERSONA_STATE_MAPPING )) {
318
294
return 'Unknown status: ' .$ key ;
319
295
}
320
296
321
- return self ::$ personaStateMapping [$ key ];
297
+ return self ::PERSONA_STATE_MAPPING [$ key ];
322
298
}
323
299
324
300
/**
@@ -347,11 +323,11 @@ public function getCommunityVisibilityState(): int
347
323
public function getCommunityVisibilityStateString (): string
348
324
{
349
325
$ key = $ this ->getCommunityVisibilityState ();
350
- if (!array_key_exists ($ key , self ::$ communityVisibilityStateMapping )) {
326
+ if (!array_key_exists ($ key , self ::COMMUNITY_VISIBILITY_STATE_MAPPING )) {
351
327
return 'Unknown profile visibility: ' .$ key ;
352
328
}
353
329
354
- return self ::$ communityVisibilityStateMapping [$ key ];
330
+ return self ::COMMUNITY_VISIBILITY_STATE_MAPPING [$ key ];
355
331
}
356
332
357
333
/**
0 commit comments