/** * @group disconnected */ public function testFilterVariadicValues() { $arguments = array('key', 'value1', 'value2', 'value3'); $this->assertSame($arguments, Helpers::filterVariadicValues($arguments)); $this->assertSame($arguments, Helpers::filterVariadicValues(array('key', array('value1', 'value2', 'value3')))); $arguments = array(array(), array()); $this->assertSame($arguments, Helpers::filterArrayArguments($arguments)); $arguments = array(new \stdClass()); $this->assertSame($arguments, Helpers::filterArrayArguments($arguments)); }
/** * {@inheritdoc} */ protected function filterArguments(array $arguments) { return Helpers::filterArrayArguments($arguments); }
/** * Writes a Redis command on the underlying connection. * * @param string $method ID of the command. * @param array $arguments List of arguments. */ private function writeCommand($method, $arguments) { $arguments = Helpers::filterArrayArguments($arguments); $command = $this->client->createCommand($method, $arguments); $this->client->getConnection()->writeCommand($command); }
/** * {@inheritdoc} */ protected function writeCommand($method, $arguments, $callback = null) { $arguments = Helpers::filterArrayArguments($arguments ?: array()); $command = $this->client->createCommand($method, $arguments); $this->client->executeCommand($command, $callback); }