44
55namespace Phpcq \PluginApi \Version10 \Definition \Builder ;
66
7+ use Phpcq \PluginApi \Version10 \Exception \RuntimeException ;
8+
79/**
810 * Interface describes a console application provided by a plugin.
11+ *
12+ * An application may contain either commands or arguments.
913 */
1014interface ConsoleApplicationBuilderInterface
1115{
12- /**
13- * Adds a description to the console application.
14- *
15- * @param string $description The description of the console application
16- *
17- * @return self
18- */
19- public function withDescription (string $ description ): self ;
20-
2116 /**
2217 * Describe which value separator is used.
2318 *
@@ -36,14 +31,27 @@ public function withOptionValueSeparator(string $separator): self;
3631 * @param string $description The command description.
3732 *
3833 * @return ConsoleCommandBuilderInterface
34+ *
35+ * @throws RuntimeException When a command with the name is already described or any argument is described.
3936 */
4037 public function describeCommand (string $ name , string $ description ): ConsoleCommandBuilderInterface ;
4138
39+ /**
40+ * Adds a new argument to the command with a name and a description.
41+ *
42+ * The order of the arguments descriptions defines the order of the expected arguments.
43+ *
44+ * @throws RuntimeException When an argument with the name is already described or any command is described.
45+ */
46+ public function describeArgument (string $ name , string $ description ): ConsoleArgumentBuilderInterface ;
47+
4248 /**
4349 * Adds a new option to the exec task which will be available independent of the concrete command.
4450 *
4551 * @param string $name The option name.
4652 * @param string $description The option description.
53+ *
54+ * @throws RuntimeException When an option with the name is already described.
4755 */
4856 public function describeOption (string $ name , string $ description ): ConsoleOptionBuilderInterface ;
4957}
0 commit comments