private function prepareKeyValue(array $dictionary, $command)
    {
        $keys = array_values(array_filter($dictionary, function ($key) {
            return $key % 2 == 0;
        }, ARRAY_FILTER_USE_KEY));
        $values = array_values(array_filter($dictionary, function ($key) {
            return $key % 2 == 1;
        }, ARRAY_FILTER_USE_KEY));

        if (count($keys) != count($values)) {
            throw new RedisProxyException("Wrong number of arguments for $command command");
        }
        return array_combine($keys, $values);
    }
private function prepareKeyValue(array $dictionary, $command)
    {
        $keys = array_values(array_filter($dictionary, function ($key) {
            return $key % 2 == 0;
        }, ARRAY_FILTER_USE_KEY));
        $values = array_values(array_filter($dictionary, function ($key) {
            return $key % 2 == 1;
        }, ARRAY_FILTER_USE_KEY));

        if (count($keys) != count($values)) {
            throw new RedisProxyException("Wrong number of arguments for $command command");
        }
        return array_combine($keys, $values);
    }
private function prepareKeyValue ( array $ dictionary , $ command ) { $ keys = array_values ( array_filter ( $ dictionary , function ( $ key ) { return $ key % 2 == 0 ; } , ARRAY_FILTER_USE_KEY ) ) ; $ values = array_values ( array_filter ( $ dictionary , function ( $ key ) { return $ key % 2 == 1 ; } , ARRAY_FILTER_USE_KEY ) ) ; if ( count ( $ keys ) != count ( $ values ) ) { throw new RedisProxyException ( "Wrong number of arguments for $command command" ) ; } return array_combine ( $ keys , $ values ) ; }
Create array from input array - odd keys are used as keys, even keys are used as values
@param array $dictionary
@param string $command
@return array
@throws RedisProxyException if number of keys is not the same as number of values
Create array from input array - odd keys are used as keys even keys are used as values