Skip to content

Commit be0e040

Browse files
committed
Make sure there is a dot at the end of the description
1 parent 22864bb commit be0e040

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Commands/Index.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function listCommands() : void
7171
' ' . CLI::style($name, ForegroundColor::green) . ' '
7272
// @phpstan-ignore-next-line
7373
. \str_repeat(' ', $width - $lengths[$name])
74-
. $command->getDescription()
74+
. $this->editDescription($command->getDescription())
7575
);
7676
}
7777
\ksort($groups);
@@ -84,12 +84,21 @@ protected function listCommands() : void
8484
' ' . CLI::style($name, ForegroundColor::green) . ' '
8585
// @phpstan-ignore-next-line
8686
. \str_repeat(' ', $width - $lengths[$name])
87-
. $command->getDescription()
87+
. $this->editDescription($command->getDescription())
8888
);
8989
}
9090
}
9191
}
9292

93+
protected function editDescription(string $description) : string
94+
{
95+
$description = \trim($description);
96+
if (!\str_ends_with($description, '.')) {
97+
$description .= '.';
98+
}
99+
return $description;
100+
}
101+
93102
/**
94103
* @param array<string,Command> $commands
95104
*

0 commit comments

Comments
 (0)