Skip to content

Commit

Permalink
Do not override PHP constants, only use when available
Browse files Browse the repository at this point in the history
  • Loading branch information
dosten authored and fabpot committed May 1, 2015
1 parent 6a32264 commit 24c6df2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Dumper/JsonFileDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

use Symfony\Component\Translation\MessageCatalogue;

if (!defined('JSON_PRETTY_PRINT')) {
define('JSON_PRETTY_PRINT', 128);
}

/**
* JsonFileDumper generates an json formatted string representation of a message catalogue.
*
Expand All @@ -29,7 +25,7 @@ class JsonFileDumper extends FileDumper
*/
public function format(MessageCatalogue $messages, $domain = 'messages')
{
return json_encode($messages->all($domain), JSON_PRETTY_PRINT);
return json_encode($messages->all($domain), defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0);
}

/**
Expand Down

0 comments on commit 24c6df2

Please sign in to comment.