mirror of
https://github.com/predis/predis.git
synced 2026-10-10 22:07:31 +00:00
Convert monolithic one-file-lib to a proper PSR-0 file tree
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Predis\Protocols;
|
||||
|
||||
use Predis\Utils;
|
||||
use Predis\CommunicationException;
|
||||
use Predis\MalformedServerResponse;
|
||||
use Predis\Network\IConnectionSingle;
|
||||
use Predis\Iterators\MultiBulkResponseSimple;
|
||||
|
||||
class ResponseMultiBulkStreamHandler implements IResponseHandler {
|
||||
public function handle(IConnectionSingle $connection, $lengthString) {
|
||||
$length = (int) $lengthString;
|
||||
if ($length != $lengthString) {
|
||||
Utils::onCommunicationException(new MalformedServerResponse(
|
||||
$connection, "Cannot parse '$length' as data length"
|
||||
));
|
||||
}
|
||||
return new MultiBulkResponseSimple($connection, $length);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user