@@ -365,7 +365,7 @@ final public function getSynopsis(bool $withMarkup = true, ?int $width = 80, boo
365365
366366 $ name = $ b . $ this ->getNameWithProgram () . $ b ;
367367 $ full = $ this ->getOptionsSynopsis ($ withMarkup , $ style , $ collapsed );
368- $ synopsis = Arr::implodeNotEmpty (' ' , [$ name , $ full ]);
368+ $ synopsis = Arr::implode (' ' , [$ name , $ full ]);
369369
370370 if ($ width !== null ) {
371371 $ wrapped = $ prefix . str_replace (
@@ -378,7 +378,7 @@ final public function getSynopsis(bool $withMarkup = true, ?int $width = 80, boo
378378 return $ wrapped ;
379379 }
380380
381- $ synopsis = Arr::implodeNotEmpty (' ' , [$ name , $ collapsed ]);
381+ $ synopsis = Arr::implode (' ' , [$ name , $ collapsed ]);
382382 }
383383
384384 return $ prefix . $ this
@@ -750,8 +750,8 @@ private function loadOptionValues(): void
750750
751751 /**
752752 * @param string[] $args
753- * @param array<string,array<string|int>|string|int|bool|null> $argValues
754- * @return array<string,array<string|int>|string|int|bool|null>
753+ * @param array<string,array<string|int|true >|string|int|bool|null> $argValues
754+ * @return array<string,array<string|int|true >|string|int|bool|null>
755755 */
756756 private function mergeArguments (
757757 array $ args ,
@@ -771,7 +771,7 @@ function (string $key, $value) use (&$argValues, &$saved, &$option) {
771771 ($ option ->IsFlag && !$ option ->MultipleAllowed )) {
772772 $ argValues [$ key ] = $ value ;
773773 } else {
774- $ argValues [$ key ] = array_merge ((array ) $ argValues [$ key ], Convert:: toArray ($ value ));
774+ $ argValues [$ key ] = array_merge ((array ) $ argValues [$ key ], Arr:: wrap ($ value ));
775775 }
776776 };
777777 $ merged = [];
@@ -870,7 +870,7 @@ function (string $key, $value) use (&$argValues, &$saved, &$option) {
870870
871871 if (array_key_exists ($ key , $ merged ) &&
872872 !($ option ->IsFlag && !$ option ->MultipleAllowed )) {
873- $ merged [$ key ] = array_merge ((array ) $ merged [$ key ], Convert:: toArray ($ value ));
873+ $ merged [$ key ] = array_merge ((array ) $ merged [$ key ], Arr:: wrap ($ value ));
874874 } else {
875875 $ merged [$ key ] = $ value ;
876876 }
@@ -1009,8 +1009,8 @@ final protected function getDefaultOptionValues(?callable $nameCallback = null):
10091009 * Optionally normalise an array of option values, assign them to the
10101010 * command, and return them to the caller
10111011 *
1012- * @param array<string,array<string|int>|string|int|bool|null> $values An
1013- * array that maps options to values.
1012+ * @param array<string,array<string|int|true >|string|int|bool|null> $values
1013+ * An array that maps options to values.
10141014 * @param bool $normalise `false` if `$value` has already been normalised.
10151015 * @param bool $expand If `true`, replace `null` (or `true`, if the option
10161016 * is not a flag and doesn't have type {@see CliOptionValueType::BOOLEAN})
@@ -1163,7 +1163,7 @@ final protected function getEffectiveCommandLine(
11631163 $ positional = [];
11641164 foreach ($ this ->Options as $ option ) {
11651165 $ name = null ;
1166- foreach (Arr::notEmpty ([$ option ->Long , $ option ->Short ]) as $ key ) {
1166+ foreach (Arr::whereNotEmpty ([$ option ->Long , $ option ->Short ]) as $ key ) {
11671167 if (array_key_exists ($ key , $ values )) {
11681168 $ name = $ key ;
11691169 break ;
@@ -1182,7 +1182,7 @@ final protected function getEffectiveCommandLine(
11821182 }
11831183 array_push ($ args , ...$ positional );
11841184
1185- return array_values (Arr::notNull ($ args ));
1185+ return array_values (Arr::whereNotNull ($ args ));
11861186 }
11871187
11881188 /**
0 commit comments