27
27
/**
28
28
* Redis client.
29
29
*
30
- * @see http://redis.io/topics/protocol Redis protocol specification.
31
- * @see https://github.com/antirez/RESP3/blob/master/spec.md Redis protocol specification.
30
+ * @see https://redis.io/docs/latest/develop/reference/protocol-spec/ Redis protocol specification.
32
31
*
33
32
* @method mixed aclLoad(...$arguments)
34
33
* @method mixed aclSave(...$arguments)
@@ -463,17 +462,17 @@ protected function handleSimpleStringResponse(string $response): string
463
462
}
464
463
465
464
/**
466
- * Handles a blob string response.
465
+ * Handles a bulk string response.
467
466
*/
468
- protected function handleBlobStringResponse (string $ response ): ?string
467
+ protected function handleBulkStringResponse (string $ response ): ?string
469
468
{
470
469
if ($ response === '$-1 ' ) {
471
470
return null ;
472
471
}
473
472
474
473
$ length = substr ($ response , 1 );
475
474
476
- // Do we have a streamed blob string response?
475
+ // Do we have a streamed bulk string response?
477
476
478
477
if ($ length === '? ' ) {
479
478
$ string = '' ;
@@ -489,7 +488,7 @@ protected function handleBlobStringResponse(string $response): ?string
489
488
return $ string ;
490
489
}
491
490
492
- // It was just a normal blob string response
491
+ // It was just a normal bulk string response
493
492
494
493
return substr ($ this ->connection ->read ((int ) $ length + static ::CRLF_LENGTH ), 0 , -static ::CRLF_LENGTH );
495
494
}
@@ -505,9 +504,9 @@ protected function handleVerbatimStringResponse(string $response): string
505
504
}
506
505
507
506
/**
508
- * Handles a number response.
507
+ * Handles an integer response.
509
508
*/
510
- protected function handleNumberResponse (string $ response ): int
509
+ protected function handleIntegerResponse (string $ response ): int
511
510
{
512
511
return (int ) substr ($ response , 1 );
513
512
}
@@ -680,9 +679,9 @@ protected function handleSimpleErrorResponse(string $response): mixed
680
679
}
681
680
682
681
/**
683
- * Handles blob error responses.
682
+ * Handles bulk error responses.
684
683
*/
685
- protected function handleBlobErrorResponse (string $ response ): void
684
+ protected function handleBulkErrorResponse (string $ response ): void
686
685
{
687
686
$ length = (int ) substr ($ response , 1 );
688
687
@@ -700,9 +699,9 @@ protected function getResponse(): mixed
700
699
701
700
return match (substr ($ response , 0 , 1 )) {
702
701
'+ ' => $ this ->handleSimpleStringResponse ($ response ),
703
- '$ ' => $ this ->handleBlobStringResponse ($ response ),
702
+ '$ ' => $ this ->handleBulkStringResponse ($ response ),
704
703
'= ' => $ this ->handleVerbatimStringResponse ($ response ),
705
- ': ' => $ this ->handleNumberResponse ($ response ),
704
+ ': ' => $ this ->handleIntegerResponse ($ response ),
706
705
', ' => $ this ->handleDoubleResponse ($ response ),
707
706
'( ' => $ this ->handleBigNumberResponse ($ response ),
708
707
'# ' => $ this ->handleBooleanResponse ($ response ),
@@ -712,7 +711,7 @@ protected function getResponse(): mixed
712
711
'| ' => $ this ->handleAttributeResponse ($ response ),
713
712
'> ' => $ this ->handlePushResponse ($ response ),
714
713
'- ' => $ this ->handleSimpleErrorResponse ($ response ),
715
- '! ' => $ this ->handleBlobErrorResponse ($ response ),
714
+ '! ' => $ this ->handleBulkErrorResponse ($ response ),
716
715
'_ ' => null ,
717
716
'. ' => static ::END ,
718
717
default => throw new RedisException (vsprintf ('Unable to handle server response [ %s ]. ' , [$ response ])),
0 commit comments