Sha256: 505dae7a2bc6dcdf5094fc1c412aa15f108756ad4d58775c16c7ed48d25ddd36

Contents?: true

Size: 622 Bytes

Versions: 7

Compression:

Stored size: 622 Bytes

Contents

<?php

namespace Predis\Protocol\Text;

use Predis\Helpers;
use Predis\Protocol\IResponseHandler;
use Predis\Protocol\ProtocolException;
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;
    }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
appstats-0.25.1 doc/benchmarks/Predis/Protocol/Text/ResponseIntegerHandler.php
appstats-0.25.0 doc/benchmarks/Predis/Protocol/Text/ResponseIntegerHandler.php
appstats-0.24.0 doc/benchmarks/Predis/Protocol/Text/ResponseIntegerHandler.php
appstats-0.23.5 doc/benchmarks/Predis/Protocol/Text/ResponseIntegerHandler.php
appstats-0.23.4 doc/benchmarks/Predis/Protocol/Text/ResponseIntegerHandler.php
appstats-0.23.3 doc/benchmarks/Predis/Protocol/Text/ResponseIntegerHandler.php
appstats-0.23.2 doc/benchmarks/Predis/Protocol/Text/ResponseIntegerHandler.php