From cfd10228782f5c438dbd28b591bdfe9b2e27f8a0 Mon Sep 17 00:00:00 2001 From: ogizanagi Date: Sat, 16 May 2015 11:34:01 +0200 Subject: [PATCH] [Console] SymfonyStyle : fix blocks failed when $messages is null. Using the `SymfonyStyle:block` method with `null` as first argument failed, where most of other methods accepting both string and array arguments will simply output an empty string. --- src/Symfony/Component/Console/Style/SymfonyStyle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index a1cd407a2a..6d69eca54a 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -60,7 +60,7 @@ class SymfonyStyle extends OutputStyle */ public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false) { - $messages = array_values((array) $messages); + $messages = is_array($messages) ? array_values($messages) : array($messages); $lines = array(); // add type