4 namespace Stecman\Component\Symfony\Console\BashCompletion\Completion;
6 interface CompletionInterface
8 // Sugar for indicating that a Completion should run for all command names and for all types
9 // Intended to avoid meaningless null parameters in the constructors of implementing classes
10 const ALL_COMMANDS = null;
11 const ALL_TYPES = null;
13 const TYPE_OPTION = 'option';
14 const TYPE_ARGUMENT = 'argument';
17 * Return the type of input (option/argument) completion should be run for
19 * @see \Symfony\Component\Console\Command\Command::addArgument
20 * @see \Symfony\Component\Console\Command\Command::addOption
21 * @return string - one of the CompletionInterface::TYPE_* constants
23 public function getType();
26 * Return the name of the command completion should be run for
27 * If the return value is CompletionInterface::ALL_COMMANDS, the completion will be run for any command name
29 * @see \Symfony\Component\Console\Command\Command::setName
32 public function getCommandName();
35 * Return the option/argument name the completion should be run for
36 * CompletionInterface::getType determines whether the target name refers to an option or an argument
40 public function getTargetName();
43 * Execute the completion
45 * @return string[] - an array of possible completion values
47 public function run();