Skip to content

Commit

Permalink
Prettify arrays in orm:mapping:describe command
Browse files Browse the repository at this point in the history
This will prevent excessive column width and wrapping in the output which uses Symfony\Component\Console\Style\SymfonyStyle::table().
  • Loading branch information
rtek authored and lcobucci committed Nov 16, 2019
1 parent 57496e3 commit 0c36f87
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -26,6 +26,10 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use const JSON_PRETTY_PRINT;
use const JSON_UNESCAPED_SLASHES;
use const JSON_UNESCAPED_UNICODE;
use function json_encode;

/**
* Show information about mapped entities.
Expand Down Expand Up @@ -213,7 +217,7 @@ private function formatValue($value)
}

if (is_array($value)) {
return json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
return json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
}

if (is_object($value)) {
Expand Down

0 comments on commit 0c36f87

Please sign in to comment.