Reorganize the Predis\Protocols namespace.

This commit is contained in:
Daniele Alessandri
2011-04-06 17:52:39 +02:00
parent 80f1cedf79
commit db95350c37
15 changed files with 42 additions and 30 deletions
@@ -0,0 +1,21 @@
<?php
namespace Predis\Protocols\Text;
use Predis\Helpers;
use Predis\ProtocolException;
use Predis\Protocols\IResponseHandler;
use Predis\Network\IConnectionComposable;
use Predis\Iterators\MultiBulkResponseSimple;
class ResponseMultiBulkStreamHandler implements IResponseHandler {
public function handle(IConnectionComposable $connection, $lengthString) {
$length = (int) $lengthString;
if ($length != $lengthString) {
Helpers::onCommunicationException(new ProtocolException(
$connection, "Cannot parse '$length' as data length"
));
}
return new MultiBulkResponseSimple($connection, $length);
}
}