@@ -40,14 +40,15 @@ public function __construct(string $buffer = '')
40
40
$ this ->size = \strlen ($ this ->data );
41
41
42
42
if (!isset (self ::$ isLittleEndian )) {
43
- self ::$ isLittleEndian = \unpack ("S " , "\x01\x00" )[1 ] === 1 ;
43
+ self ::$ isLittleEndian = \unpack ("S " , "\x01\x00" )[1 ] === 1 ;
44
44
}
45
45
}
46
46
47
47
/**
48
48
* @param string|static $value
49
49
*
50
50
* @return static
51
+ * @throws \TypeError
51
52
*/
52
53
public function append ($ value ): self
53
54
{
@@ -220,6 +221,7 @@ public function appendInt8(int $value): self
220
221
* @param int $offset
221
222
*
222
223
* @return int
224
+ * @throws BufferOverflow
223
225
*/
224
226
public function readInt8 (int $ offset = 0 ): int
225
227
{
@@ -228,6 +230,7 @@ public function readInt8(int $offset = 0): int
228
230
229
231
/**
230
232
* @return int
233
+ * @throws BufferOverflow
231
234
*/
232
235
public function consumeInt8 (): int
233
236
{
@@ -248,6 +251,7 @@ public function appendInt16(int $value): self
248
251
* @param int $offset
249
252
*
250
253
* @return int
254
+ * @throws BufferOverflow
251
255
*/
252
256
public function readInt16 (int $ offset = 0 ): int
253
257
{
@@ -256,6 +260,7 @@ public function readInt16(int $offset = 0): int
256
260
257
261
/**
258
262
* @return int
263
+ * @throws BufferOverflow
259
264
*/
260
265
public function consumeInt16 (): int
261
266
{
@@ -276,6 +281,7 @@ public function appendInt32(int $value): self
276
281
* @param int $offset
277
282
*
278
283
* @return int
284
+ * @throws BufferOverflow
279
285
*/
280
286
public function readInt32 (int $ offset = 0 ): int
281
287
{
@@ -284,6 +290,7 @@ public function readInt32(int $offset = 0): int
284
290
285
291
/**
286
292
* @return int
293
+ * @throws BufferOverflow
287
294
*/
288
295
public function consumeInt32 (): int
289
296
{
@@ -304,6 +311,7 @@ public function appendInt64(int $value): self
304
311
* @param int $offset
305
312
*
306
313
* @return int
314
+ * @throws BufferOverflow
307
315
*/
308
316
public function readInt64 (int $ offset = 0 ): int
309
317
{
@@ -312,6 +320,7 @@ public function readInt64(int $offset = 0): int
312
320
313
321
/**
314
322
* @return int
323
+ * @throws BufferOverflow
315
324
*/
316
325
public function consumeInt64 (): int
317
326
{
@@ -332,6 +341,7 @@ public function appendUint8(int $value): self
332
341
* @param int $offset
333
342
*
334
343
* @return int
344
+ * @throws BufferOverflow
335
345
*/
336
346
public function readUint8 (int $ offset = 0 ): int
337
347
{
@@ -340,6 +350,7 @@ public function readUint8(int $offset = 0): int
340
350
341
351
/**
342
352
* @return int
353
+ * @throws BufferOverflow
343
354
*/
344
355
public function consumeUint8 (): int
345
356
{
@@ -364,6 +375,7 @@ public function appendUint16(int $value): self
364
375
* @param int $offset
365
376
*
366
377
* @return int
378
+ * @throws BufferOverflow
367
379
*/
368
380
public function readUint16 (int $ offset = 0 ): int
369
381
{
@@ -372,6 +384,7 @@ public function readUint16(int $offset = 0): int
372
384
373
385
/**
374
386
* @return int
387
+ * @throws BufferOverflow
375
388
*/
376
389
public function consumeUint16 (): int
377
390
{
@@ -396,6 +409,7 @@ public function appendUint32(int $value): self
396
409
* @param int $offset
397
410
*
398
411
* @return int
412
+ * @throws BufferOverflow
399
413
*/
400
414
public function readUint32 (int $ offset = 0 ): int
401
415
{
@@ -404,6 +418,7 @@ public function readUint32(int $offset = 0): int
404
418
405
419
/**
406
420
* @return int
421
+ * @throws BufferOverflow
407
422
*/
408
423
public function consumeUint32 (): int
409
424
{
@@ -428,6 +443,7 @@ public function appendUint64(int $value): self
428
443
* @param int $offset
429
444
*
430
445
* @return int
446
+ * @throws BufferOverflow
431
447
*/
432
448
public function readUint64 (int $ offset = 0 ): int
433
449
{
@@ -436,6 +452,7 @@ public function readUint64(int $offset = 0): int
436
452
437
453
/**
438
454
* @return int
455
+ * @throws BufferOverflow
439
456
*/
440
457
public function consumeUint64 (): int
441
458
{
@@ -456,6 +473,7 @@ public function appendFloat(float $value): self
456
473
* @param int $offset
457
474
*
458
475
* @return float
476
+ * @throws BufferOverflow
459
477
*/
460
478
public function readFloat (int $ offset = 0 ): float
461
479
{
@@ -464,6 +482,7 @@ public function readFloat(int $offset = 0): float
464
482
465
483
/**
466
484
* @return float
485
+ * @throws BufferOverflow
467
486
*/
468
487
public function consumeFloat (): float
469
488
{
@@ -484,6 +503,7 @@ public function appendDouble($value): self
484
503
* @param int $offset
485
504
*
486
505
* @return float
506
+ * @throws BufferOverflow
487
507
*/
488
508
public function readDouble (int $ offset = 0 ): float
489
509
{
@@ -492,6 +512,7 @@ public function readDouble(int $offset = 0): float
492
512
493
513
/**
494
514
* @return float
515
+ * @throws BufferOverflow
495
516
*/
496
517
public function consumeDouble (): float
497
518
{
0 commit comments