@@ -40,12 +40,8 @@ public function __construct(Writer $writer = null)
4040
4141 /**
4242 * Print stack trace and error msg of an exception.
43- *
44- * @param \Throwable $e
45- *
46- * @return void
4743 */
48- public function printTrace (\Throwable $ e )
44+ public function printTrace (\Throwable $ e ): void
4945 {
5046 $ eClass = \get_class ($ e );
5147
@@ -78,7 +74,7 @@ public function printTrace(\Throwable $e)
7874 $ this ->writer ->colors ($ traceStr );
7975 }
8076
81- protected function stringifyArgs (array $ args )
77+ protected function stringifyArgs (array $ args ): string
8278 {
8379 $ holder = [];
8480
@@ -89,7 +85,7 @@ protected function stringifyArgs(array $args)
8985 return \implode (', ' , $ holder );
9086 }
9187
92- protected function stringifyArg ($ arg )
88+ protected function stringifyArg ($ arg ): string
9389 {
9490 if (\is_scalar ($ arg )) {
9591 return \var_export ($ arg , true );
@@ -152,15 +148,8 @@ public function showCommandsHelp(array $commands, string $header = '', string $f
152148
153149 /**
154150 * Show help with headers and footers.
155- *
156- * @param string $for
157- * @param array $items
158- * @param string $header
159- * @param string $footer
160- *
161- * @return void
162151 */
163- protected function showHelp (string $ for , array $ items , string $ header = '' , string $ footer = '' )
152+ protected function showHelp (string $ for , array $ items , string $ header = '' , string $ footer = '' ): void
164153 {
165154 if ($ header ) {
166155 $ this ->writer ->bold ($ header , true );
@@ -192,10 +181,6 @@ protected function showHelp(string $for, array $items, string $header = '', stri
192181 * Show usage examples of a Command.
193182 *
194183 * It replaces $0 with actual command name and properly pads ` ## ` segments.
195- *
196- * @param string $usage Usage description.
197- *
198- * @return self
199184 */
200185 public function showUsage (string $ usage ): self
201186 {
@@ -215,11 +200,6 @@ public function showUsage(string $usage): self
215200 }
216201
217202 $ maxlen = ($ lines ? \max ($ lines ) : 0 ) + 4 ;
218- // $usage = \preg_replace_callback(
219- // '~ ## ~',
220- // fn() => \str_pad('# ', $maxlen - \array_shift($lines), ' ', \STR_PAD_LEFT),
221- // $usage
222- // );
223203 $ usage = \preg_replace_callback ('~ ## ~ ' , function () use (&$ lines , $ maxlen ) {
224204 return \str_pad ('# ' , $ maxlen - \array_shift ($ lines ), ' ' , \STR_PAD_LEFT );
225205 }, $ usage );
@@ -261,8 +241,6 @@ protected function sortItems(array $items, &$max = 0): array
261241 {
262242 $ max = \max (\array_map (fn ($ item ) => \strlen ($ this ->getName ($ item )), $ items ));
263243
264- /* @var Parameter $b */
265- /* @var Parameter $a */
266244 \uasort ($ items , fn ($ a , $ b ) => $ a ->name () <=> $ b ->name ());
267245
268246 return $ items ;
@@ -288,12 +266,8 @@ protected function getName($item): string
288266
289267 /**
290268 * Get parameter label for humans.
291- *
292- * @param Parameter $item
293- *
294- * @return string
295269 */
296- protected function label (Parameter $ item )
270+ protected function label (Parameter $ item ): string
297271 {
298272 $ name = $ item ->name ();
299273
0 commit comments