@@ -47,7 +47,13 @@ public function get_tools(): array {
4747
4848 $ command_desc = $ command ->get_shortdesc ();
4949 $ command_synopsis = $ command ->get_synopsis ();
50- $ synopsis_spec = SynopsisParser::parse ( $ command_synopsis );
50+
51+ /**
52+ * Parsed synopsys.
53+ *
54+ * @var array<int, array{optional?: bool, type: string, repeating: bool, name: string}> $synopsis_spec
55+ */
56+ $ synopsis_spec = SynopsisParser::parse ( $ command_synopsis );
5157
5258 $ properties = [];
5359 $ required = [];
@@ -64,7 +70,7 @@ public function get_tools(): array {
6470 $ prop_name = str_replace ( '- ' , '_ ' , $ arg ['name ' ] );
6571 $ properties [ $ prop_name ] = [
6672 'type ' => 'string ' ,
67- 'description ' => $ arg [ ' description ' ] ?? "Parameter {$ arg ['name ' ]}" ,
73+ 'description ' => "Parameter {$ arg ['name ' ]}" ,
6874 ];
6975
7076 if ( ! isset ( $ arg ['optional ' ] ) || ! $ arg ['optional ' ] ) {
@@ -133,7 +139,13 @@ public function get_tools(): array {
133139 $ subcommand_name = $ subcommand ->get_name ();
134140 $ subcommand_desc = $ subcommand ->get_shortdesc () ?? "Runs WP-CLI command: $ subcommand_name " ;
135141 $ subcommand_synopsis = $ subcommand ->get_synopsis ();
136- $ synopsis_spec = SynopsisParser::parse ( $ subcommand_synopsis );
142+
143+ /**
144+ * Parsed synopsys.
145+ *
146+ * @var array<int, array{optional?: bool, type: string, repeating: bool, name: string}> $synopsis_spec
147+ */
148+ $ synopsis_spec = SynopsisParser::parse ( $ subcommand_synopsis );
137149
138150 $ properties = [];
139151 $ required = [];
@@ -149,7 +161,7 @@ public function get_tools(): array {
149161 if ( 'positional ' === $ arg ['type ' ] || 'assoc ' === $ arg ['type ' ] ) {
150162 $ properties [ $ prop_name ] = [
151163 'type ' => 'string ' ,
152- 'description ' => $ arg [ ' description ' ] ?? "Parameter {$ arg ['name ' ]}" ,
164+ 'description ' => "Parameter {$ arg ['name ' ]}" ,
153165 ];
154166 }
155167
0 commit comments