4f1ca05ac47d209f8a40c582ddf5405cf93129c0
[yaffs-website] / vendor / stecman / symfony-console-completion / src / Completion / CompletionInterface.php
1 <?php
2
3
4 namespace Stecman\Component\Symfony\Console\BashCompletion\Completion;
5
6 interface CompletionInterface
7 {
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;
12
13     const TYPE_OPTION = 'option';
14     const TYPE_ARGUMENT = 'argument';
15
16     /**
17      * Return the type of input (option/argument) completion should be run for
18      *
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
22      */
23     public function getType();
24
25     /**
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
28      *
29      * @see \Symfony\Component\Console\Command\Command::setName
30      * @return string|null
31      */
32     public function getCommandName();
33
34     /**
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
37      *
38      * @return string
39      */
40     public function getTargetName();
41
42     /**
43      * Execute the completion
44      *
45      * @return string[] - an array of possible completion values
46      */
47     public function run();
48 }