| 1 | <?php |
||
| 21 | class ApplicationConfig extends BaseApplicationConfig |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * Starts a configuration block for a command. |
||
| 25 | * |
||
| 26 | * The configuration of the command is returned by this method. You can use |
||
| 27 | * the fluent interface to configure the sub-command before jumping back to |
||
| 28 | * this configuration with {@link CommandConfig::end()}: |
||
| 29 | * |
||
| 30 | * ```php |
||
| 31 | * protected function configure() |
||
| 32 | * { |
||
| 33 | * $this |
||
| 34 | * ->setName('server') |
||
| 35 | * ->setDescription('List and manage servers') |
||
| 36 | * |
||
| 37 | * ->beginCommand('add') |
||
| 38 | * ->setDescription('Add a server') |
||
| 39 | * ->addArgument('host', Argument::REQUIRED) |
||
| 40 | * ->addOption('port', 'p', Option::VALUE_OPTIONAL, null, 80) |
||
| 41 | * ->end() |
||
| 42 | * |
||
| 43 | * // ... |
||
| 44 | * ; |
||
| 45 | * } |
||
| 46 | * ``` |
||
| 47 | * |
||
| 48 | * @param string $name The name of the command. |
||
| 49 | * |
||
| 50 | * @return CommandConfig The command configuration. |
||
| 51 | * |
||
| 52 | * @see editCommand() |
||
| 53 | */ |
||
| 54 | public function beginCommand($name) |
||
| 62 | } |
||
| 63 |