From 689e9bf001d68b6555b3be31596ba7935d78c862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Mon, 20 Jan 2014 10:15:51 +0100 Subject: [PATCH] [FrameworkBundle] Pretty Ppint json ouput of yaml:lint command --- .../Bundle/FrameworkBundle/Command/YamlLintCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php index 54c446de33013..b7f46d1e9d163 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php @@ -11,6 +11,10 @@ namespace Symfony\Bundle\FrameworkBundle\Command; +if (!defined('JSON_PRETTY_PRINT')) { + define('JSON_PRETTY_PRINT', 128); +} + use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -151,7 +155,7 @@ private function displayJson(OutputInterface $output, $filesInfo) } }); - $output->writeln(json_encode($filesInfo)); + $output->writeln(json_encode($filesInfo, JSON_PRETTY_PRINT)); return min($errors, 1); }