[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.
This commit is contained in:
ogizanagi 2015-05-16 11:34:01 +02:00 committed by maxime.steinhausser
parent 0542a17b5b
commit cfd1022878

View File

@ -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