From 4b75362d7fcbcfdc5cb477aced88ab9c97fb3961 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Translation/Resources/bin/translation-status.php b/src/Symfony/Component/Translation/Resources/bin/translation-status.php index acc8b4e227222..295ae13686b2f 100644 --- a/src/Symfony/Component/Translation/Resources/bin/translation-status.php +++ b/src/Symfony/Component/Translation/Resources/bin/translation-status.php @@ -159,6 +159,10 @@ function printTitle($title) function printTable($translations, $verboseOutput) { + if (count($translations) === 0) { + echo 'No translations found'; + return; + } $longestLocaleNameLength = max(array_map('strlen', array_keys($translations))); foreach ($translations as $locale => $translation) {