Predis\Configuration\Option\Commands::filter PHP Метод

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

public filter ( Predis\Configuration\OptionsInterface $options, $value )
$options Predis\Configuration\OptionsInterface
    public function filter(OptionsInterface $options, $value)
    {
        if (is_callable($value)) {
            $value = call_user_func($value, $options);
        }
        if (is_array($value)) {
            $commands = $this->getDefault($options);
            foreach ($value as $commandID => $classFQN) {
                $commands->defineCommand($commandID, $classFQN);
            }
            return $commands;
        }
        if (!$value instanceof FactoryInterface) {
            $class = get_called_class();
            throw new \InvalidArgumentException("{$class} expects a valid command factory");
        }
        return $value;
    }