original_string: public static function encode($data, $prettyPrint = false)
      {
          if ($prettyPrint) {
              // Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant
              if (version_compare(PHP_VERSION, '5.4.0', '>=') && defined('JSON_PRETTY_PRINT')) {
                  return json_encode($data, JSON_PRETTY_PRINT);
              } else {
                  $jsonPretty = new JsonPretty();
                  return $jsonPretty->prettify($data, null, '    ');
              }
          }
  
          return json_encode($data);
      }
code: public static function encode($data, $prettyPrint = false)
      {
          if ($prettyPrint) {
              // Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant
              if (version_compare(PHP_VERSION, '5.4.0', '>=') && defined('JSON_PRETTY_PRINT')) {
                  return json_encode($data, JSON_PRETTY_PRINT);
              } else {
                  $jsonPretty = new JsonPretty();
                  return $jsonPretty->prettify($data, null, '    ');
              }
          }
  
          return json_encode($data);
      }
code_tokens: public static function encode ( $ data , $ prettyPrint = false ) { if ( $ prettyPrint ) { // Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant if ( version_compare ( PHP_VERSION , '5.4.0' , '>=' ) && defined ( 'JSON_PRETTY_PRINT' ) ) { return json_encode ( $ data , JSON_PRETTY_PRINT ) ; } else { $ jsonPretty = new JsonPretty ( ) ; return $ jsonPretty -> prettify ( $ data , null , '    ' ) ; } } return json_encode ( $ data ) ; }
docstring: Encodes an array to json strutcture
  @param  array   $data        Data to encode
  @param  boolean $prettyPrint True to output the encoded data a little bit more readable for the humans
  @return string
docstring_tokens: Encodes an array to json strutcture