1 | <?php |
||
7 | class Summary |
||
8 | { |
||
9 | /** |
||
10 | * @var \League\CLImate\CLImate $climate |
||
11 | */ |
||
12 | protected $climate; |
||
13 | |||
14 | /** |
||
15 | * @var string $description |
||
16 | */ |
||
17 | protected $description; |
||
18 | |||
19 | /** |
||
20 | * @var string $command |
||
21 | */ |
||
22 | protected $command; |
||
23 | |||
24 | /** |
||
25 | * @var Filter $filter |
||
26 | */ |
||
27 | protected $filter; |
||
28 | |||
29 | /** |
||
30 | * @param \League\CLImate\CLImate $climate |
||
31 | * |
||
32 | * @return \League\CLImate\Argument\Summary |
||
33 | */ |
||
34 | 4 | public function setClimate(CLImate $climate) |
|
40 | |||
41 | /** |
||
42 | * @param string $description |
||
43 | * |
||
44 | * @return \League\CLImate\Argument\Summary |
||
45 | */ |
||
46 | 4 | public function setDescription($description) |
|
52 | |||
53 | /** |
||
54 | * @param string $command |
||
55 | * |
||
56 | * @return \League\CLImate\Argument\Summary |
||
57 | */ |
||
58 | 4 | public function setCommand($command) |
|
64 | |||
65 | /** |
||
66 | * @param Filter $filter |
||
67 | * @param Argument[] $arguments |
||
68 | * |
||
69 | * @return \League\CLImate\Argument\Summary |
||
70 | */ |
||
71 | 4 | public function setFilter($filter, $arguments) |
|
78 | |||
79 | /** |
||
80 | * Output the full summary for the program |
||
81 | */ |
||
82 | 4 | public function output() |
|
98 | |||
99 | /** |
||
100 | * Build a short summary of a list of arguments. |
||
101 | * |
||
102 | * @param Argument[] $arguments |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | 8 | public function short($arguments) |
|
110 | |||
111 | /** |
||
112 | * Build an argument's summary for use in a usage statement. |
||
113 | * |
||
114 | * For example, "-u username, --user username", "--force", or |
||
115 | * "-c count (default: 7)". |
||
116 | * |
||
117 | * @param Argument $argument |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | 8 | public function argument(Argument $argument) |
|
141 | |||
142 | /** |
||
143 | * Build argument summary surrounded by brackets |
||
144 | * |
||
145 | 8 | * @param Argument $argument |
|
146 | * |
||
147 | 8 | * @return string |
|
148 | */ |
||
149 | protected function argumentBracketed(Argument $argument) |
||
153 | |||
154 | /** |
||
155 | 4 | * Get the arguments ordered by whether or not they have a prefix |
|
156 | * |
||
157 | 4 | * @return Argument[] |
|
158 | */ |
||
159 | protected function getOrderedArguments() |
||
163 | |||
164 | /** |
||
165 | * Print out the argument list |
||
166 | 4 | * |
|
167 | * @param array $arguments |
||
168 | 4 | * @param string $type |
|
169 | */ |
||
170 | protected function outputArguments($arguments, $type) |
||
186 | |||
187 | /** |
||
188 | * Builds the summary for any prefixed arguments |
||
189 | * |
||
190 | 8 | * @param Argument $argument |
|
191 | * |
||
192 | 8 | * @return string |
|
193 | 8 | */ |
|
194 | protected function prefixedArguments(Argument $argument) |
||
215 | } |
||
216 |