@@ -63,6 +63,7 @@ public function getBuffer() : string{
63
63
}
64
64
65
65
/**
66
+ * @phpstan-impure
66
67
* @throws BinaryDataException if there are not enough bytes left in the buffer
67
68
*/
68
69
public function get (int $ len ) : string {
@@ -82,6 +83,7 @@ public function get(int $len) : string{
82
83
}
83
84
84
85
/**
86
+ * @phpstan-impure
85
87
* @throws BinaryDataException
86
88
*/
87
89
public function getRemaining () : string {
@@ -98,6 +100,9 @@ public function put(string $str) : void{
98
100
$ this ->buffer .= $ str ;
99
101
}
100
102
103
+ /**
104
+ * @phpstan-impure
105
+ */
101
106
public function getBool () : bool {
102
107
return $ this ->get (1 ) !== "\x00" ;
103
108
}
@@ -106,6 +111,9 @@ public function putBool(bool $v) : void{
106
111
$ this ->buffer .= ($ v ? "\x01" : "\x00" );
107
112
}
108
113
114
+ /**
115
+ * @phpstan-impure
116
+ */
109
117
public function getByte () : int {
110
118
return ord ($ this ->get (1 ));
111
119
}
@@ -114,10 +122,16 @@ public function putByte(int $v) : void{
114
122
$ this ->buffer .= chr ($ v );
115
123
}
116
124
125
+ /**
126
+ * @phpstan-impure
127
+ */
117
128
public function getShort () : int {
118
129
return Binary::readShort ($ this ->get (2 ));
119
130
}
120
131
132
+ /**
133
+ * @phpstan-impure
134
+ */
121
135
public function getSignedShort () : int {
122
136
return Binary::readSignedShort ($ this ->get (2 ));
123
137
}
@@ -126,10 +140,16 @@ public function putShort(int $v) : void{
126
140
$ this ->buffer .= Binary::writeShort ($ v );
127
141
}
128
142
143
+ /**
144
+ * @phpstan-impure
145
+ */
129
146
public function getLShort () : int {
130
147
return Binary::readLShort ($ this ->get (2 ));
131
148
}
132
149
150
+ /**
151
+ * @phpstan-impure
152
+ */
133
153
public function getSignedLShort () : int {
134
154
return Binary::readSignedLShort ($ this ->get (2 ));
135
155
}
@@ -138,6 +158,9 @@ public function putLShort(int $v) : void{
138
158
$ this ->buffer .= Binary::writeLShort ($ v );
139
159
}
140
160
161
+ /**
162
+ * @phpstan-impure
163
+ */
141
164
public function getTriad () : int {
142
165
return Binary::readTriad ($ this ->get (3 ));
143
166
}
@@ -146,6 +169,9 @@ public function putTriad(int $v) : void{
146
169
$ this ->buffer .= Binary::writeTriad ($ v );
147
170
}
148
171
172
+ /**
173
+ * @phpstan-impure
174
+ */
149
175
public function getLTriad () : int {
150
176
return Binary::readLTriad ($ this ->get (3 ));
151
177
}
@@ -154,6 +180,9 @@ public function putLTriad(int $v) : void{
154
180
$ this ->buffer .= Binary::writeLTriad ($ v );
155
181
}
156
182
183
+ /**
184
+ * @phpstan-impure
185
+ */
157
186
public function getInt () : int {
158
187
return Binary::readInt ($ this ->get (4 ));
159
188
}
@@ -162,6 +191,9 @@ public function putInt(int $v) : void{
162
191
$ this ->buffer .= Binary::writeInt ($ v );
163
192
}
164
193
194
+ /**
195
+ * @phpstan-impure
196
+ */
165
197
public function getLInt () : int {
166
198
return Binary::readLInt ($ this ->get (4 ));
167
199
}
@@ -170,10 +202,16 @@ public function putLInt(int $v) : void{
170
202
$ this ->buffer .= Binary::writeLInt ($ v );
171
203
}
172
204
205
+ /**
206
+ * @phpstan-impure
207
+ */
173
208
public function getFloat () : float {
174
209
return Binary::readFloat ($ this ->get (4 ));
175
210
}
176
211
212
+ /**
213
+ * @phpstan-impure
214
+ */
177
215
public function getRoundedFloat (int $ accuracy ) : float {
178
216
return Binary::readRoundedFloat ($ this ->get (4 ), $ accuracy );
179
217
}
@@ -182,10 +220,16 @@ public function putFloat(float $v) : void{
182
220
$ this ->buffer .= Binary::writeFloat ($ v );
183
221
}
184
222
223
+ /**
224
+ * @phpstan-impure
225
+ */
185
226
public function getLFloat () : float {
186
227
return Binary::readLFloat ($ this ->get (4 ));
187
228
}
188
229
230
+ /**
231
+ * @phpstan-impure
232
+ */
189
233
public function getRoundedLFloat (int $ accuracy ) : float {
190
234
return Binary::readRoundedLFloat ($ this ->get (4 ), $ accuracy );
191
235
}
@@ -194,6 +238,9 @@ public function putLFloat(float $v) : void{
194
238
$ this ->buffer .= Binary::writeLFloat ($ v );
195
239
}
196
240
241
+ /**
242
+ * @phpstan-impure
243
+ */
197
244
public function getDouble () : float {
198
245
return Binary::readDouble ($ this ->get (8 ));
199
246
}
@@ -202,6 +249,9 @@ public function putDouble(float $v) : void{
202
249
$ this ->buffer .= Binary::writeDouble ($ v );
203
250
}
204
251
252
+ /**
253
+ * @phpstan-impure
254
+ */
205
255
public function getLDouble () : float {
206
256
return Binary::readLDouble ($ this ->get (8 ));
207
257
}
@@ -210,6 +260,9 @@ public function putLDouble(float $v) : void{
210
260
$ this ->buffer .= Binary::writeLDouble ($ v );
211
261
}
212
262
263
+ /**
264
+ * @phpstan-impure
265
+ */
213
266
public function getLong () : int {
214
267
return Binary::readLong ($ this ->get (8 ));
215
268
}
@@ -218,6 +271,9 @@ public function putLong(int $v) : void{
218
271
$ this ->buffer .= Binary::writeLong ($ v );
219
272
}
220
273
274
+ /**
275
+ * @phpstan-impure
276
+ */
221
277
public function getLLong () : int {
222
278
return Binary::readLLong ($ this ->get (8 ));
223
279
}
@@ -228,6 +284,8 @@ public function putLLong(int $v) : void{
228
284
229
285
/**
230
286
* Reads a 32-bit variable-length unsigned integer from the buffer and returns it.
287
+ *
288
+ * @phpstan-impure
231
289
*/
232
290
public function getUnsignedVarInt () : int {
233
291
return Binary::readUnsignedVarInt ($ this ->buffer , $ this ->offset );
@@ -242,6 +300,8 @@ public function putUnsignedVarInt(int $v) : void{
242
300
243
301
/**
244
302
* Reads a 32-bit zigzag-encoded variable-length integer from the buffer and returns it.
303
+ *
304
+ * @phpstan-impure
245
305
*/
246
306
public function getVarInt () : int {
247
307
return Binary::readVarInt ($ this ->buffer , $ this ->offset );
@@ -256,6 +316,8 @@ public function putVarInt(int $v) : void{
256
316
257
317
/**
258
318
* Reads a 64-bit variable-length integer from the buffer and returns it.
319
+ *
320
+ * @phpstan-impure
259
321
*/
260
322
public function getUnsignedVarLong () : int {
261
323
return Binary::readUnsignedVarLong ($ this ->buffer , $ this ->offset );
@@ -270,6 +332,8 @@ public function putUnsignedVarLong(int $v) : void{
270
332
271
333
/**
272
334
* Reads a 64-bit zigzag-encoded variable-length integer from the buffer and returns it.
335
+ *
336
+ * @phpstan-impure
273
337
*/
274
338
public function getVarLong () : int {
275
339
return Binary::readVarLong ($ this ->buffer , $ this ->offset );
0 commit comments