From 79b1fb83338b73af25f1949bfcea54a6b74905c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 7 Apr 2019 09:54:46 +0200 Subject: [PATCH] Handle case where no translations were found Right now, the program emits a warning when trying to use max() on an empty array. --- .../Translation/Resources/bin/translation-status.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Symfony/Component/Translation/Resources/bin/translation-status.php b/src/Symfony/Component/Translation/Resources/bin/translation-status.php index acc8b4e22722..0d37c3e0aa38 100644 --- a/src/Symfony/Component/Translation/Resources/bin/translation-status.php +++ b/src/Symfony/Component/Translation/Resources/bin/translation-status.php @@ -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) {