Files
predis/src/Command/FactoryInterface.php
T
Daniele Alessandri cc2a7657db Rework Predis\Command\FactoryInterface and related classes.
We have renamed most methods to drop the "command" suffix as it is quite
redundant. Due to this change and thanks to variadic methods introduced
with PHP 5.6 we took the opportunity to replace both "supportsCommand()"
and "supportsCommands()" with a single new method "supports()".

Added more stringent typehints for method arguments and typehints for
return values now that we do not need to support anything below PHP 7.2.
Also moved from using array() to [] in source code of class involved.
2020-08-28 14:23:12 +02:00

44 lines
1.1 KiB
PHP

<?php
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Predis\Command;
/**
* Command factory interface.
*
* A command factory is used through the library to create instances of commands
* classes implementing Predis\Command\CommandInterface mapped to Redis commands
* by their command ID string (SET, GET, etc...).
*
* @author Daniele Alessandri <suppakilla@gmail.com>
*/
interface FactoryInterface
{
/**
* Checks if the command factory supports the specified list of commands.
*
* @param array $commandIDs List of command IDs
*
* @return bool
*/
public function supports(string ...$commandIDs): bool;
/**
* Creates a new command instance.
*
* @param string $commandID Command ID
* @param array $arguments Arguments for the command
*
* @return CommandInterface
*/
public function create(string $commandID, array $arguments = array()): CommandInterface;
}