original_string: public static function renderJSON($data = [], $flags = null)
      {
          if (is_null($flags)) {
              $flags = JSON_HEX_TAG | JSON_HEX_APOS
                  | JSON_HEX_AMP | JSON_HEX_QUOT
                  | JSON_UNESCAPED_SLASHES;
          }
  
          json_encode(null); // clear json_last_error()
          $result = json_encode($data, $flags);
  
          if (JSON_ERROR_NONE !== json_last_error()) {
              throw new InvalidArgumentException(
                  sprintf(
                      'Unable to encode data to JSON in %s: %s', __CLASS__,
                      json_last_error_msg()
                  )
              );
          }
  
          return $result;
      }
code: public static function renderJSON($data = [], $flags = null)
      {
          if (is_null($flags)) {
              $flags = JSON_HEX_TAG | JSON_HEX_APOS
                  | JSON_HEX_AMP | JSON_HEX_QUOT
                  | JSON_UNESCAPED_SLASHES;
          }
  
          json_encode(null); // clear json_last_error()
          $result = json_encode($data, $flags);
  
          if (JSON_ERROR_NONE !== json_last_error()) {
              throw new InvalidArgumentException(
                  sprintf(
                      'Unable to encode data to JSON in %s: %s', __CLASS__,
                      json_last_error_msg()
                  )
              );
          }
  
          return $result;
      }
code_tokens: public static function renderJSON ( $ data = [ ] , $ flags = null ) { if ( is_null ( $ flags ) ) { $ flags = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_SLASHES ; } json_encode ( null ) ; // clear json_last_error() $ result = json_encode ( $ data , $ flags ) ; if ( JSON_ERROR_NONE !== json_last_error ( ) ) { throw new InvalidArgumentException ( sprintf ( 'Unable to encode data to JSON in %s: %s' , __CLASS__ , json_last_error_msg ( ) ) ) ; } return $ result ; }
docstring: Json Encode String with given flags
  
  @param array   $data  Associative array of variables names and values.
  @param integer $flags json_encode options
  
  @throws InvalidArgumentException
  @return string JSON string
docstring_tokens: Json Encode String with given flags