Predis to v2.2.2

This commit is contained in:
the-djmaze
2024-04-02 20:15:23 +02:00
parent f6b440adef
commit 84ffe1e552
259 changed files with 2407 additions and 9937 deletions

View File

@@ -3,7 +3,8 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -23,18 +24,13 @@ use Predis\Response\Status as StatusResponse;
/**
* Protocol processor for the standard Redis wire protocol.
*
* @link http://redis.io/topics/protocol
*
* @author Daniele Alessandri <suppakilla@gmail.com>
* @see http://redis.io/topics/protocol
*/
class ProtocolProcessor implements ProtocolProcessorInterface
{
protected $mbiterable;
protected $serializer;
/**
*
*/
public function __construct()
{
$this->mbiterable = false;
@@ -81,7 +77,7 @@ class ProtocolProcessor implements ProtocolProcessorInterface
return new MultiBulkIterator($connection, $count);
}
$multibulk = array();
$multibulk = [];
for ($i = 0; $i < $count; ++$i) {
$multibulk[$i] = $this->read($connection);
@@ -90,14 +86,16 @@ class ProtocolProcessor implements ProtocolProcessorInterface
return $multibulk;
case ':':
return (int) $payload;
$integer = (int) $payload;
return $integer == $payload ? $integer : $payload;
case '-':
return new ErrorResponse($payload);
default:
CommunicationException::handle(new ProtocolException(
$connection, "Unknown response prefix: '$prefix'."
$connection, "Unknown response prefix: '$prefix' [{$connection->getParameters()}]"
));
return;