Predis\Command\Factory::defineCommand PHP Метод

defineCommand() публичный Метод

Defines a new command in the factory.
public defineCommand ( string $commandID, string $class )
$commandID string Command ID.
$class string Fully-qualified name of a Predis\Command\CommandInterface.
    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;
    }