8000 Handle case where no translations were found · symfony/symfony@79b1fb8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 79b1fb8

Browse files
committed
Handle case where no translations were found
Right now, the program emits a warning when trying to use max() on an empty array.
1 parent 98f26cb commit 79b1fb8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Translation/Resources/bin/translation-status.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ function printTitle($title)
159159

160160
function printTable($translations, $verboseOutput)
161161
{
162+
if (0 === count($translations)) {
163+
echo 'No translations found';
164+
165+
return;
166+
}
162167
$longestLocaleNameLength = max(array_map('strlen', array_keys($translations)));
163168

164169
foreach ($translations as $locale => $translation) {

0 commit comments

Comments
 (0)
0