/** * Extracts the key from EVAL and EVALSHA commands. * * @param CommandInterface $command Command instance. * @return string */ protected function getKeyFromScriptingCommands(CommandInterface $command) { if ($command instanceof ScriptedCommand) { $keys = $command->getKeys(); } else { $keys = array_slice($args = $command->getArguments(), 2, $args[1]); } if ($keys && $this->checkSameHashForKeys($keys)) { return $keys[0]; } }
/** * Extracts the key from EVAL and EVALSHA commands. * * @param CommandInterface $command Command instance. * @return string */ protected function getKeyFromScriptingCommands(CommandInterface $command) { if ($command instanceof ScriptedCommand) { $keys = $command->getKeys(); } else { $keys = array_slice($args = $command->getArguments(), 2, $args[1]); } if (count($keys) === 1) { return $keys[0]; } }