original_string: protected function toJson($data, bool $ignoreErrors = false)
      {
          // suppress json_encode errors since it's twitchy with some inputs
          if ($ignoreErrors) {
              return @$this->jsonEncode($data);
          }
  
          $json = $this->jsonEncode($data);
  
          if ($json === false) {
              $json = $this->handleJsonError(json_last_error(), $data);
          }
  
          return $json;
      }
code: protected function toJson($data, bool $ignoreErrors = false)
      {
          // suppress json_encode errors since it's twitchy with some inputs
          if ($ignoreErrors) {
              return @$this->jsonEncode($data);
          }
  
          $json = $this->jsonEncode($data);
  
          if ($json === false) {
              $json = $this->handleJsonError(json_last_error(), $data);
          }
  
          return $json;
      }
code_tokens: protected function toJson ( $ data , bool $ ignoreErrors = false ) { // suppress json_encode errors since it's twitchy with some inputs if ( $ ignoreErrors ) { return @ $ this -> jsonEncode ( $ data ) ; } $ json = $ this -> jsonEncode ( $ data ) ; if ( $ json === false ) { $ json = $ this -> handleJsonError ( json_last_error ( ) , $ data ) ; } return $ json ; }
docstring: Return the JSON representation of a value
  
  @param  mixed             $data
  @throws \RuntimeException if encoding fails and errors are not ignored
  @return string|bool
docstring_tokens: Return the JSON representation of a value