Skip to content

Commit 2cf6cad

Browse files
committed
Cleaning up
1 parent 623dc68 commit 2cf6cad

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/mako/database/query/Result.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace mako\database\query;
99

10+
use AllowDynamicProperties;
1011
use JsonSerializable;
1112
use Stringable;
1213

@@ -16,7 +17,7 @@
1617
/**
1718
* Result.
1819
*/
19-
#[\AllowDynamicProperties]
20+
#[AllowDynamicProperties]
2021
class Result implements JsonSerializable, Stringable
2122
{
2223
/**

src/mako/redis/Redis.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
/**
2828
* Redis client.
2929
*
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.
3231
*
3332
* @method mixed aclLoad(...$arguments)
3433
* @method mixed aclSave(...$arguments)
@@ -463,17 +462,17 @@ protected function handleSimpleStringResponse(string $response): string
463462
}
464463

465464
/**
466-
* Handles a blob string response.
465+
* Handles a bulk string response.
467466
*/
468-
protected function handleBlobStringResponse(string $response): ?string
467+
protected function handleBulkStringResponse(string $response): ?string
469468
{
470469
if ($response === '$-1') {
471470
return null;
472471
}
473472

474473
$length = substr($response, 1);
475474

476-
// Do we have a streamed blob string response?
475+
// Do we have a streamed bulk string response?
477476
478477
if ($length === '?') {
479478
$string = '';
@@ -489,7 +488,7 @@ protected function handleBlobStringResponse(string $response): ?string
489488
return $string;
490489
}
491490

492-
// It was just a normal blob string response
491+
// It was just a normal bulk string response
493492

494493
return substr($this->connection->read((int) $length + static::CRLF_LENGTH), 0, -static::CRLF_LENGTH);
495494
}
@@ -505,9 +504,9 @@ protected function handleVerbatimStringResponse(string $response): string
505504
}
506505

507506
/**
508-
* Handles a number response.
507+
* Handles an integer response.
509508
*/
510-
protected function handleNumberResponse(string $response): int
509+
protected function handleIntegerResponse(string $response): int
511510
{
512511
return (int) substr($response, 1);
513512
}
@@ -680,9 +679,9 @@ protected function handleSimpleErrorResponse(string $response): mixed
680679
}
681680

682681
/**
683-
* Handles blob error responses.
682+
* Handles bulk error responses.
684683
*/
685-
protected function handleBlobErrorResponse(string $response): void
684+
protected function handleBulkErrorResponse(string $response): void
686685
{
687686
$length = (int) substr($response, 1);
688687

@@ -700,9 +699,9 @@ protected function getResponse(): mixed
700699

701700
return match (substr($response, 0, 1)) {
702701
'+' => $this->handleSimpleStringResponse($response),
703-
'$' => $this->handleBlobStringResponse($response),
702+
'$' => $this->handleBulkStringResponse($response),
704703
'=' => $this->handleVerbatimStringResponse($response),
705-
':' => $this->handleNumberResponse($response),
704+
':' => $this->handleIntegerResponse($response),
706705
',' => $this->handleDoubleResponse($response),
707706
'(' => $this->handleBigNumberResponse($response),
708707
'#' => $this->handleBooleanResponse($response),
@@ -712,7 +711,7 @@ protected function getResponse(): mixed
712711
'|' => $this->handleAttributeResponse($response),
713712
'>' => $this->handlePushResponse($response),
714713
'-' => $this->handleSimpleErrorResponse($response),
715-
'!' => $this->handleBlobErrorResponse($response),
714+
'!' => $this->handleBulkErrorResponse($response),
716715
'_' => null,
717716
'.' => static::END,
718717
default => throw new RedisException(vsprintf('Unable to handle server response [ %s ].', [$response])),

0 commit comments

Comments
 (0)