Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4b75362

Browse filesBrowse 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 4b75362
Copy full SHA for 4b75362

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Resources/bin/translation-status.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ function printTitle($title)
159159

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

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.