Passing the separator after the array is no longer supported

This commit is contained in:
Norbert Wagner 2023-03-23 08:50:28 +01:00
commit cedd316946

View file

@ -169,7 +169,7 @@ if (!function_exists(__NAMESPACE__.'usage')) {
: $a->name() : $a->name()
); );
} }
$arguments = trim(implode($arguments, ' ')); $arguments = trim(implode(' ', $arguments));
return sprintf( return sprintf(
'Usage: %s [OPTIONS]... %s%s', 'Usage: %s [OPTIONS]... %s%s',
@ -217,13 +217,13 @@ if (!function_exists(__NAMESPACE__.'manpage')) {
// Add the arguments, if there are any. // Add the arguments, if there are any.
if (false === empty($arguments)) { if (false === empty($arguments)) {
$sections[] = $heading('Arguments:'); $sections[] = $heading('Arguments:');
$sections[] = $colourise(implode($arguments, PHP_EOL)).PHP_EOL; $sections[] = $colourise(implode(PHP_EOL, $arguments)).PHP_EOL;
} }
// Add the options, if there are any. // Add the options, if there are any.
if (false === empty($options)) { if (false === empty($options)) {
$sections[] = $heading('Options:'); $sections[] = $heading('Options:');
$sections[] = $colourise(implode($options, PHP_EOL)).PHP_EOL; $sections[] = $colourise(implode(PHP_EOL, $options)).PHP_EOL;
} }
// Iterate over all additional items and add them as new sections // Iterate over all additional items and add them as new sections
@ -232,7 +232,7 @@ if (!function_exists(__NAMESPACE__.'manpage')) {
$sections[] = $colourise($contents).PHP_EOL; $sections[] = $colourise($contents).PHP_EOL;
} }
return implode($sections, PHP_EOL); return implode(PHP_EOL, $sections);
} }
} }