original_string: protected function json($data, bool $encode = true) : Response
      {
          if ($encode) {
              $data = json_encode($data);
          }
  
          return $this->createResponse($data, 'application/json');
      }
code: protected function json($data, bool $encode = true) : Response
      {
          if ($encode) {
              $data = json_encode($data);
          }
  
          return $this->createResponse($data, 'application/json');
      }
code_tokens: protected function json ( $ data , bool $ encode = true ) : Response { if ( $ encode ) { $ data = json_encode ( $ data ) ; } return $ this -> createResponse ( $ data , 'application/json' ) ; }
docstring: Returns a JSON response.
  
  @param mixed $data   The data to encode, or a valid JSON string if `$encode` == `false`.
  @param bool  $encode Whether to JSON-encode the data.
  
  @return \Brick\Http\Response
docstring_tokens: Returns a JSON response .