Skip to content

Commit

Permalink
Handle case where no translations were found
Browse files Browse the repository at this point in the history
Right now, the program emits a warning when trying to use max() on an
empty array.
  • Loading branch information
greg0ire committed Apr 7, 2019
1 parent 98f26cb commit 79b1fb8
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -159,6 +159,11 @@ function printTitle($title)

function printTable($translations, $verboseOutput)
{
if (0 === count($translations)) {
echo 'No translations found';

return;
}
$longestLocaleNameLength = max(array_map('strlen', array_keys($translations)));

foreach ($translations as $locale => $translation) {
Expand Down

0 comments on commit 79b1fb8

Please sign in to comment.