public function defineCommand($commandID, $class)
{
if ($class !== null) {
$reflection = new \ReflectionClass($class);
if (!$reflection->isSubclassOf('Predis\\Command\\CommandInterface')) {
throw new \InvalidArgumentException("The class '{$class}' is not a valid command class.");
}
}
$this->commands[strtoupper($commandID)] = $class;
}