mirror of
https://github.com/predis/predis.git
synced 2026-10-10 22:07:31 +00:00
Rename the Predis\Protocols namespace to Predis\Protocol.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Predis\Protocol\Text;
|
||||
|
||||
use Predis\Helpers;
|
||||
use Predis\ProtocolException;
|
||||
use Predis\Protocol\IResponseHandler;
|
||||
use Predis\Network\IConnectionComposable;
|
||||
|
||||
class ResponseIntegerHandler implements IResponseHandler {
|
||||
public function handle(IConnectionComposable $connection, $number) {
|
||||
if (is_numeric($number)) {
|
||||
return (int) $number;
|
||||
}
|
||||
if ($number !== 'nil') {
|
||||
Helpers::onCommunicationException(new ProtocolException(
|
||||
$connection, "Cannot parse '$number' as numeric response"
|
||||
));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user